Example usage for org.springframework.security.acls.domain PermissionFactory buildFromMask

List of usage examples for org.springframework.security.acls.domain PermissionFactory buildFromMask

Introduction

In this page you can find the example usage for org.springframework.security.acls.domain PermissionFactory buildFromMask.

Prototype

Permission buildFromMask(int mask);

Source Link

Document

Dynamically creates a CumulativePermission or BasePermission representing the active bits in the passed mask.

Usage

From source file:net.projectmonkey.spring.acl.hbase.repository.AccessControlEntryValue.java

public AccessControlEntryValue(final byte[] key, final PermissionFactory permissionFactory) {
    Assert.notNull(key, "key must not be null");
    Assert.notNull(permissionFactory, "permissionFactory must not be null");
    String keyString = new String(key);
    String[] values = keyString.split(SEPARATOR);
    String authority = values[1];
    boolean principal = Boolean.valueOf(values[2]);
    int permissionMask = Integer.parseInt(values[3]);

    Assert.isTrue(values.length == 5, "Key must consist of 5 values separated by :");

    this.id = UUID.fromString(values[0]);
    this.sid = SidUtil.createSid(authority, principal);
    this.permission = permissionFactory.buildFromMask(permissionMask);
    this.granting = Boolean.valueOf(values[4]);
    this.authority = authority;
    this.key = key;
}