org.camunda.bpm.engine.authorization.Authorization.isEveryPermissionRevoked()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中org.camunda.bpm.engine.authorization.Authorization.isEveryPermissionRevoked()方法的一些代码示例,展示了Authorization.isEveryPermissionRevoked()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Authorization.isEveryPermissionRevoked()方法的具体详情如下:
包路径:org.camunda.bpm.engine.authorization.Authorization
类名称:Authorization
方法名:isEveryPermissionRevoked

Authorization.isEveryPermissionRevoked介绍

[英]Allows checking whether this authorization revokes every single permission.
[中]允许检查此授权是否撤消每个权限。

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

public static String[] getNamesForPermissions(Authorization authorization, Permission[] permissions) {
 int type = authorization.getAuthorizationType();
 // special case all permissions are granted
 if ((type == Authorization.AUTH_TYPE_GLOBAL || type == Authorization.AUTH_TYPE_GRANT)
   && authorization.isEveryPermissionGranted()) {
  return new String[] { Permissions.ALL.getName() };
 }
 // special case all permissions are revoked
 if (type == Authorization.AUTH_TYPE_REVOKE && authorization.isEveryPermissionRevoked()) {
  return new String[] { Permissions.ALL.getName() };
 }
 List<String> names = new ArrayList<String>();
 for (Permission permission : permissions) {
  String name = permission.getName();
  // filter NONE and ALL from permissions array
  if (!name.equals(Permissions.NONE.getName()) && !name.equals(Permissions.ALL.getName())) {
   names.add(name);
  }
 }
 return names.toArray(new String[names.size()]);
}

代码示例来源:origin: camunda/camunda-bpm-platform

public static String[] getNamesForPermissions(Authorization authorization, Permission[] permissions) {
 int type = authorization.getAuthorizationType();
 // special case all permissions are granted
 if ((type == Authorization.AUTH_TYPE_GLOBAL || type == Authorization.AUTH_TYPE_GRANT)
   && authorization.isEveryPermissionGranted()) {
  return new String[] { Permissions.ALL.getName() };
 }
 // special case all permissions are revoked
 if (type == Authorization.AUTH_TYPE_REVOKE && authorization.isEveryPermissionRevoked()) {
  return new String[] { Permissions.ALL.getName() };
 }
 List<String> names = new ArrayList<String>();
 for (Permission permission : permissions) {
  String name = permission.getName();
  // filter NONE and ALL from permissions array
  if (!name.equals(Permissions.NONE.getName()) && !name.equals(Permissions.ALL.getName())) {
   names.add(name);
  }
 }
 return names.toArray(new String[names.size()]);
}

代码示例来源:origin: org.camunda.bpm/camunda-engine-rest-jaxrs2

public static String[] getNamesForPermissions(Authorization authorization, Permission[] permissions) {
 int type = authorization.getAuthorizationType();
 // special case all permissions are granted
 if ((type == Authorization.AUTH_TYPE_GLOBAL || type == Authorization.AUTH_TYPE_GRANT)
   && authorization.isEveryPermissionGranted()) {
  return new String[] { Permissions.ALL.getName() };
 }
 // special case all permissions are revoked
 if (type == Authorization.AUTH_TYPE_REVOKE && authorization.isEveryPermissionRevoked()) {
  return new String[] { Permissions.ALL.getName() };
 }
 List<String> names = new ArrayList<String>();
 for (Permission permission : permissions) {
  String name = permission.getName();
  // filter NONE and ALL from permissions array
  if (!name.equals(Permissions.NONE.getName()) && !name.equals(Permissions.ALL.getName())) {
   names.add(name);
  }
 }
 return names.toArray(new String[names.size()]);
}

相关文章