/*
 * Copyright 2011 DTO Solutions, Inc. (http://dtosolutions.com)
 *
 * 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.
 */

/*
* AuthConstants.java
* 
* User: Greg Schueler <a href="mailto:greg@dtosolutions.com">greg@dtosolutions.com</a>
* Created: 9/1/11 9:20 AM
* 
*/
package com.dtolabs.rundeck.server.authorization;

import java.util.*;

/**
 * AuthConstants is ...
 *
 * @author Greg Schueler <a href="mailto:greg@dtosolutions.com">greg@dtosolutions.com</a>
 */
public class AuthConstants {
    public static final String ACTION_CREATE = "create";
    public static final String ACTION_READ = "read";
    public static final String ACTION_UPDATE = "update";
    public static final String ACTION_DELETE = "delete";
    public static final String ACTION_RUN = "run";
    public static final String ACTION_KILL = "kill";
    public static final String ACTION_ADMIN = "admin";
    public static final String ACTION_REFRESH = "refresh";
    public static final String ACTION_RUNAS = "runAs";
    public static final String ACTION_KILLAS = "killAs";
    public static final String ACTION_CONFIGURE = "configure";
    public static final String ACTION_IMPORT= "import";
    public static final String ACTION_EXPORT= "export";

}

/*
 * Copyright 2011 DTO Solutions, Inc. (http://dtosolutions.com)
 *
 * 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.
 */

/*
* AuthConstants.java
* 
* User: Greg Schueler <a href="mailto:greg@dtosolutions.com">greg@dtosolutions.com</a>
* Created: 9/1/11 9:20 AM
* 
*/
package com.dtolabs.rundeck.server.authorization;

import com.dtolabs.rundeck.core.authorization.AuthorizationUtil;

import java.util.*;

/**
 * AuthConstants is ...
 *
 * @author Greg Schueler <a href="mailto:greg@dtosolutions.com">greg@dtosolutions.com</a>
 */
public class AuthConstants {
    public static final String ACTION_CREATE = "create";
    public static final String ACTION_READ = "read";
    public static final String ACTION_UPDATE = "update";
    public static final String ACTION_DELETE = "delete";
    public static final String ACTION_RUN = "run";
    public static final String ACTION_KILL = "kill";
    public static final String ACTION_ADMIN = "admin";
    public static final String ACTION_REFRESH = "refresh";
    public static final String ACTION_RUNAS = "runAs";
    public static final String ACTION_KILLAS = "killAs";
    public static final String ACTION_CONFIGURE = "configure";
    public static final String ACTION_IMPORT = "import";
    public static final String ACTION_EXPORT = "export";

    public static final String TYPE_SYSTEM = "system";
    public static final String TYPE_NODE = "node";
    public static final String TYPE_JOB = "job";
    public static final String TYPE_ADHOC = "adhoc";
    public static final String TYPE_PROJECT = "project";
    public static final String TYPE_EVENT = "event";

    private static Map<String, String> resType(String type) {
        return Collections.unmodifiableMap(AuthorizationUtil.resourceType(type));
    }

    public static final Map<String, String> RESOURCE_TYPE_SYSTEM = resType(TYPE_SYSTEM);
    public static final Map<String, String> RESOURCE_TYPE_NODE = resType(TYPE_NODE);
    public static final Map<String, String> RESOURCE_TYPE_JOB = resType(TYPE_JOB);
    public static final Map<String, String> RESOURCE_TYPE_EVENT = resType(TYPE_EVENT);
    public static final Map<String, String> RESOURCE_ADHOC = Collections.unmodifiableMap(AuthorizationUtil
            .resource(TYPE_ADHOC));
}

Define constants for resource types and maps