1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package org.xwiki.security.authorization

File AuthorizationSettler.java

 

Code metrics

0
0
0
1
57
13
0
-
-
0
-

Classes

Class Line # Actions
AuthorizationSettler 37 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.Collection;
23    import java.util.Deque;
24   
25    import org.xwiki.component.annotation.Role;
26    import org.xwiki.security.GroupSecurityReference;
27    import org.xwiki.security.UserSecurityReference;
28   
29    /**
30    * An AuthorizationSettler compute the resulting access for a given user,
31    * a list of groups, and a hierarchy of rights objects defining rights on a given entity.
32    *
33    * @version $Id: 7f9baf3dc9dba2b95b6f3b31330ad555f12734a8 $
34    * @since 4.0M2
35    */
36    @Role
 
37    public interface AuthorizationSettler
38    {
39    /**
40    * Compute the current access for the user that is a member
41    * of the given groups and on an entity which is protected by the
42    * given hierarchy of rights objects.
43    *
44    * @param user a user identifier.
45    * @param groups a collection of groups.
46    * @param securityRuleEntries a hierarchy of security rules. The list
47    * is arranged such that the rules belonging to the main
48    * wiki is put in the last collection, preceded by subwiki if
49    * any, preceded by space and subspaces if any, preceded by the
50    * document rules. The levels of this hierarchy
51    * match the structure of the entity reference reported by the first SecurityRuleEntry.
52    * @return the computed access for the given user.
53    */
54    SecurityAccessEntry settle(UserSecurityReference user,
55    Collection<GroupSecurityReference> groups,
56    Deque<SecurityRuleEntry> securityRuleEntries);
57    }