This project has retired. For details please refer to its Attic page.
ArchivaRoleConstants xref
View Javadoc
1   package org.apache.archiva.security.common;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  public class ArchivaRoleConstants
23  {
24      public static final String DELIMITER = " - ";
25  
26      // globalish roles
27      public static final String SYSTEM_ADMINISTRATOR_ROLE = "System Administrator";
28  
29      public static final String USER_ADMINISTRATOR_ROLE = "User Administrator";
30      
31      public static final String GLOBAL_REPOSITORY_MANAGER_ROLE = "Global Repository Manager";
32  
33      public static final String GLOBAL_REPOSITORY_OBSERVER_ROLE = "Global Repository Observer";
34      
35      public static final String REGISTERED_USER_ROLE = "Registered User";
36  
37      public static final String GUEST_ROLE = "Guest";
38      
39      // dynamic role prefixes
40      public static final String REPOSITORY_MANAGER_ROLE_PREFIX = "Repository Manager";
41  
42      public static final String REPOSITORY_OBSERVER_ROLE_PREFIX = "Repository Observer";
43  
44      // operations
45      public static final String OPERATION_MANAGE_USERS = "archiva-manage-users";
46  
47      public static final String OPERATION_MANAGE_CONFIGURATION = "archiva-manage-configuration";
48  
49      public static final String OPERATION_ACTIVE_GUEST = "archiva-guest";
50  
51      public static final String OPERATION_RUN_INDEXER = "archiva-run-indexer";
52  
53      public static final String OPERATION_REGENERATE_INDEX = "archiva-regenerate-index";
54  
55      public static final String OPERATION_ACCESS_REPORT = "archiva-access-reports";
56  
57      public static final String OPERATION_ADD_REPOSITORY = "archiva-add-repository";
58  
59      public static final String OPERATION_REPOSITORY_ACCESS = "archiva-read-repository";
60  
61      public static final String OPERATION_DELETE_REPOSITORY = "archiva-delete-repository";
62  
63      public static final String OPERATION_EDIT_REPOSITORY = "archiva-edit-repository";
64  
65      public static final String OPERATION_REPOSITORY_UPLOAD = "archiva-upload-repository";
66  
67      public static final String OPERATION_REPOSITORY_DELETE = "archiva-delete-artifact";
68  
69      public static final String OPERATION_MERGE_REPOSITORY = "archiva-merge-repository";
70      
71      public static final String OPERATION_VIEW_AUDIT_LOG = "archiva-view-audit-logs";
72  
73      // Role templates
74      public static final String TEMPLATE_REPOSITORY_MANAGER = "archiva-repository-manager";
75      
76      public static final String TEMPLATE_REPOSITORY_OBSERVER = "archiva-repository-observer";
77      
78      public static final String TEMPLATE_GLOBAL_REPOSITORY_OBSERVER = "archiva-global-repository-observer"; 
79      
80      public static final String TEMPLATE_SYSTEM_ADMIN = "archiva-system-administrator";
81      
82      public static final String TEMPLATE_GUEST = "archiva-guest";
83      
84      public static String toRepositoryObserverRoleName( String repoId )
85      {
86          return REPOSITORY_OBSERVER_ROLE_PREFIX + " - " + repoId;
87      }
88  }