BrightSide Workbench Full Report + Source Code
org.turro.security.FlatPermissions Class Reference
Inheritance diagram for org.turro.security.FlatPermissions:
Collaboration diagram for org.turro.security.FlatPermissions:

Public Member Functions

boolean isInRole (String role)
 
boolean anyKeyMatch (List< String > roles)
 
PermissionMap asMap ()
 
void addPermissions (TreeMap< String, TreeSet< String >> rolePermissions)
 

Protected Member Functions

boolean isActor (IContact contact, String actor)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 33 of file FlatPermissions.java.

Member Function Documentation

◆ addPermissions()

void org.turro.security.FlatPermissions.addPermissions ( TreeMap< String, TreeSet< String >>  rolePermissions)

Definition at line 51 of file FlatPermissions.java.

51  {
52  rolePermissions.entrySet().forEach(entry -> {
53  TreeSet<String> set = get(entry.getKey());
54  if(set == null) set = new TreeSet<>();
55  set.addAll(entry.getValue());
56  put(entry.getKey(), set);
57  });
58  }

◆ anyKeyMatch()

boolean org.turro.security.FlatPermissions.anyKeyMatch ( List< String >  roles)

Definition at line 43 of file FlatPermissions.java.

43  {
44  return roles.stream().anyMatch(role -> containsKey(role));
45  }

◆ asMap()

PermissionMap org.turro.security.FlatPermissions.asMap ( )

Definition at line 47 of file FlatPermissions.java.

47  {
48  return new PermissionMap(this);
49  }
Here is the caller graph for this function:

◆ isActor()

boolean org.turro.security.FlatPermissions.isActor ( IContact  contact,
String  actor 
)
protected

Definition at line 60 of file FlatPermissions.java.

60  {
61  if(contact == null) contact = (IContact) Application.getUser();
62  return Actors.isActor(contact, actor);
63  }
Here is the call graph for this function:

◆ isInRole()

boolean org.turro.security.FlatPermissions.isInRole ( String  role)

Definition at line 35 of file FlatPermissions.java.

35  {
36  String[] roles = role.split("\\s*\\|\\s*");
37  for(String r : roles) {
38  if(checkRole(r)) return true;
39  }
40  return false;
41  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: