本文整理汇总了Java中org.springframework.security.acls.domain.CumulativePermission.set方法的典型用法代码示例。如果您正苦于以下问题:Java CumulativePermission.set方法的具体用法?Java CumulativePermission.set怎么用?Java CumulativePermission.set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.security.acls.domain.CumulativePermission
的用法示例。
在下文中一共展示了CumulativePermission.set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parsePerms
import org.springframework.security.acls.domain.CumulativePermission; //导入方法依赖的package包/类
private static Permission parsePerms(String perms) {
final int length = perms.length();
if(length > 32) {
throw new IllegalArgumentException("Too long permission expression: " + perms + " it must be shortest than 32 chars.");
}
Permission perm;
if(length == 1) {
perm = parseLetter(perms.charAt(0));
} else {
CumulativePermission cp = new CumulativePermission();
for(int i = 0; i < length; ++i) {
cp.set(parseLetter(perms.charAt(i)));
}
perm = cp;
}
return perm;
}
示例2: buildFromMask
import org.springframework.security.acls.domain.CumulativePermission; //导入方法依赖的package包/类
public static Permission buildFromMask(int mask) {
if (permissionsByInteger.containsKey(mask)) {
return permissionsByInteger.get(mask);
}
// to get this far, we have to use a CumulativePermission
CumulativePermission cumulativePermission = new CumulativePermission();
for (int i = 0; i < 32; i++) {
int permissionToCheck = 1 << i;
if ((mask & permissionToCheck) == permissionToCheck) {
Permission permission = permissionsByInteger.get(permissionToCheck);
if (permission == null) {
System.out.println("Mask " + permissionToCheck + " does not have a corresponding static NextServerPermission");
continue;
}
cumulativePermission.set(permission);
}
}
return cumulativePermission;
}