1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.security.authorization

File RightDescription.java

 

Code metrics

0
0
0
1
77
13
0
-
-
0
-

Classes

Class Line # Actions
RightDescription 32 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.security.authorization;
21   
22    import java.util.Set;
23   
24    import org.xwiki.model.EntityType;
25   
26    /**
27    * Describe a {@link Right}, allow adding new Rights, also implemented by the {@link Right} class.
28    *
29    * @version $Id: 1e698060fe7dc96a182a110516767e7b76a75927 $
30    * @since 4.0M2
31    */
 
32    public interface RightDescription
33    {
34    /**
35    * @return The string representation of this right.
36    */
37    String getName();
38   
39    /**
40    * @return The default state, in case no matching right is found
41    * at any level. Should be either {@link RuleState#ALLOW} or {@link RuleState#DENY}.
42    */
43    RuleState getDefaultState();
44   
45    /**
46    * @return Whether this right should be allowed or denied in case
47    * of a tie.
48    */
49    RuleState getTieResolutionPolicy();
50   
51    /**
52    * @return Policy on how this right should be overridden by
53    * lower levels in the entity reference hierarchy. When true,
54    * this right on a document override this right on a wiki.
55    */
56    boolean getInheritanceOverridePolicy();
57   
58    /**
59    * @return a set of additional rights implied by this right.
60    */
61    Set<Right> getImpliedRights();
62   
63    /**
64    * @return a set of entity type for which this right should be enabled. Special type Right.FARM (==null) could
65    * be used to target the EntityType.WIKI for the main wiki only (i.e. PROGRAM)
66    */
67    Set<EntityType> getTargetedEntityType();
68   
69    /**
70    * Used to check if this right should be allowed when the wiki is in read-only mode.
71    * From the native right, only EDIT, DELETE, COMMENT and REGISTER returns false.
72    *
73    * @return true if this right allow a read-only access to the wiki.
74    */
75    boolean isReadOnly();
76    }
77