/*
 *   Copyright 2010, Maarten Billemont
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */
package com.lyndir.lhunath.opal.security;

import org.jetbrains.annotations.Nullable;


/**
 * <h2>{@link GlobalSecureObject}<br> <sub>[in short] (TODO).</sub></h2>
 *
 * <p> <i>Mar 14, 2010</i> </p>
 *
 * @author lhunath
 */
public class GlobalSecureObject<S extends Subject> extends AbstractSecureObject<S, SecureObject<S, ?>> {

    /**
     * The default {@link SecureObject} that all top-level objects should use as their parent.
     */
    private static final transient GlobalSecureObject<Subject> DEFAULT;

    static {
        DEFAULT = new GlobalSecureObject<Subject>();
        DEFAULT.getACL().setDefaultPermission( Permission.NONE );
    }

    public static <S extends Subject> GlobalSecureObject<S> getDefault() {

        return (GlobalSecureObject<S>) DEFAULT;
    }

    @Nullable
    @Override
    public SecureObject<S, ?> getParent() {

        return null;
    }

    @Override
    public String getLocalizedType() {

        throw new UnsupportedOperationException( "This object should not be shown publicly." );
    }

    @Override
    public String getLocalizedInstance() {

        throw new UnsupportedOperationException( "This object should not be shown publicly." );
    }
}

@@ -951,462 +951,8 @@
  %7B%0A%0A
-    /**%0A     * The default %7B@link SecureObject%7D that all top-level objects should use as their parent.%0A     */%0A    private static final transient GlobalSecureObject%3CSubject%3E DEFAULT;%0A%0A    static %7B%0A        DEFAULT = new GlobalSecureObject%3CSubject%3E();%0A        DEFAULT.getACL().setDefaultPermission( Permission.NONE );%0A    %7D%0A%0A    public static %3CS extends Subject%3E GlobalSecureObject%3CS%3E getDefault() %7B%0A%0A        return (GlobalSecureObject%3CS%3E) DEFAULT;%0A    %7D%0A%0A
     

Move the default GSO to the application level.