Permissions

public class Permissions

This class defines the permissions for urls and will an object of this class will be used for every URL registration.

Fields

condition

String condition

deny_anon

boolean deny_anon

deny_exc

Set<String> deny_exc

log

static final Logger log

permissions

String[] permissions

Constructors

Permissions

public Permissions()

Intialize an empty permissions object

Methods

all

public static Permissions all(String... args)

Initialize a new permissions object with a condition ‘all’.

Parameters:
  • args – List of permissions in the format “permission-group-name/permission-name”

any

public static Permissions any(String... args)

Initialize a new permissions object with a condition ‘all’.

Parameters:
  • args – List of permissions in the format “permission-group-name/permission-name”

breakPermission

public static String[] breakPermission(String permission)

Breaks the fully qualified permission name.

Parameters:
  • permission
    • Fully qualiified permission name
Returns:

list of elements in the permission name

check

public boolean check(HttpRequest request)

This method is used internall in the framework and the application has no use for this method.

deny_anon

public Permissions deny_anon()

Deny anonymous requests on a URL

Returns:Returns ‘this’ object so that you can chain like Permissions.any(“pg1/p1”, “pg2/p2”).deny_anon()

deny_exc

public Permissions deny_exc(String... args)

Deny request from any source except the apps mentioned in the args

Parameters:
  • args – List of apps in the format ‘provider-code/app-code’
Returns:

Returns ‘this’ object so that you can chain like Permissions.any(“pg1/p1”, “pg2/p2”).deny_anon().deny_exc(‘aalam/base’)

framePermission

public static String framePermission(String provider, String app, String permissionGroup, String permission)

Returns the fully qualified permission name. Fully qualified permission name will identify a permission to which app and which permission group in the app that this permission belongs to.