Checks given permissions are needed to show rationale.

@return returns true if one of the permission is needed to show rationale.
174641
static boolean shouldShowRequestPermissionRationale(Activity activity, String... permissions) {
    for (String permission : permissions) {
      if (ActivityCompat.shouldShowRequestPermissionRationale(activity, permission)) {
        return true;
      }
    }
    return false;
  }
940619
public static boolean isAllowed(ODocument doc, OrientPermission... permissions)
	{
		if(!isAllowed(doc.getSchemaClass(), permissions)) return false;
		for (OrientPermission orientPermission : permissions) {
			ORestrictedOperation allowOperation = MAPPING_FOR_HACK.get(orientPermission);
			if(allowOperation!=null)
			{
				if(!AccessToIsAllowedInRestrictedAccessHook.INSTANCE.isAllowed(doc, allowOperation, false)) return false;
			}
		}
		return true;
	}
1293441
public static boolean isPermissionGranted(@NonNull Fragment context, @NonNull String permission) {
        return ActivityCompat.checkSelfPermission(context.getContext(), permission) == PackageManager.PERMISSION_GRANTED;
    }
1224900
private boolean isValidUserAccess(UserDefinition userDef, Permission permNeeded) {
        Set<Permission> permList = userDef.getPermissions();
        if (permList.size() == 0 || permList.contains(Permission.ALL)) {
            return true;
        }
        switch (permNeeded) {
        case APPEND:
            return permList.contains(Permission.APPEND) || permList.contains(Permission.UPDATE);
        case READ:
            return permList.contains(Permission.READ);
        case UPDATE:
            return permList.contains(Permission.UPDATE);
        default:
            return false;
        }
    }
1232966
public boolean hasPermission(final ApiKey apiKey, String permissionName) {
        if (apiKey.getTeams() == null) {
            return false;
        }
        for (final Team team: apiKey.getTeams()) {
            final List<Permission> teamPermissions = getObjectById(Team.class, team.getId()).getPermissions();
            for (final Permission permission: teamPermissions) {
                if (permission.getName().equals(permissionName)) {
                    return true;
                }
            }
        }
        return false;
    }
404907
protected Boolean _hasPermission(@Nonnull Authentication a, Permission permission) {
        // ACL entries for this principal takes precedence
        Boolean b = hasPermission(new PrincipalSid(a),permission);
        if(LOGGER.isLoggable(FINER))
            LOGGER.finer("hasPermission(PrincipalSID:"+a.getPrincipal()+","+permission+")=>"+b);
        if(b!=null)
            return b;

        // after that, we check if the groups this principal belongs to
        // has any ACL entries.
        // here we are using GrantedAuthority as a group
        for(GrantedAuthority ga : a.getAuthorities()) {
            b = hasPermission(new GrantedAuthoritySid(ga),permission);
            if(LOGGER.isLoggable(FINER))
                LOGGER.finer("hasPermission(GroupSID:"+ga.getAuthority()+","+permission+")=>"+b);
            if(b!=null)
                return b;
        }

        // permissions granted to 'everyone' and 'anonymous' users are granted to everyone
        for (Sid sid : AUTOMATIC_SIDS) {
            b = hasPermission(sid,permission);
            if(LOGGER.isLoggable(FINER))
                LOGGER.finer("hasPermission("+sid+","+permission+")=>"+b);
            if(b!=null)
                return b;
        }

        return null;
    }
1333543
def has_permission?(*levels)
      if levels.all? { |level| permissions.include? level.to_sym }
        return true
      else
        return false
      end
    end
70055
@Override
	public boolean checkPermission(Set<SecurityGroup> groups, Permission permission)
	{
		if (groups == null || groups.isEmpty())
			return false;

		for (SecurityGroup group : groups)
		{
			if (checkPermission(group, permission))
				return true;
		}

		return false;
	}
690957
public boolean hasPermission(Authentication authentication,
                                 Object resource,
                                 Object privilege) {
        boolean logPermission = isLogPermission(resource);
        return checkRole(authentication, privilege, logPermission)
            || checkPermission(authentication, resource, privilege, true, logPermission);
    }
1149213
public static boolean hasRequestedPermission(@NotNull Context context, @NotNull final String permission) {
        boolean hasRequestedPermission = false;
        if (TextUtils.isEmpty(permission)) {
            throw new IllegalArgumentException("Permission can't be null or empty.");
        }

        try {
            PackageInfo info = context.getPackageManager()
                    .getPackageInfo(context.getPackageName(), PackageManager.GET_PERMISSIONS);
            if (!CollectionUtils.isEmpty(info.requestedPermissions)) {
                for (String requestedPermission : info.requestedPermissions) {
                    if (permission.equals(requestedPermission)) {
                        hasRequestedPermission = true;
                        break;
                    }
                }
            }
        } catch (PackageManager.NameNotFoundException e) {
            Logger.e(e, "Error during checking permission ", permission);
        }
        Logger.d("hasRequestedPermission() is ", hasRequestedPermission, " for ", permission);
        return hasRequestedPermission;
    }
796313
public boolean hasPermission(Authentication authentication,
                                 Object privilege) {
        return checkRole(authentication, privilege, true)
            || checkPermission(authentication, null, privilege, false, true);
    }
521773
private int checkSelfPermission(Activity activity, String permission) {
    try {
      return androidPermissionService.checkSelfPermission(activity, permission);
    } catch (RuntimeException ignored) {
      return PackageManager.PERMISSION_DENIED;
    }
  }
1132332
def has_permission(self, request):
        """"""
        if not self.object and not self.permission:
            return True

        if not self.permission:
            return request.user.has_perm('{}_{}'.format(
                self.model_permission,
                self.object.__class__.__name__.lower()), self.object
            )

        return request.user.has_perm(self.permission)
784586
def can_read(self):
        
        sm = getSecurityManager()
        if not sm.checkPermission(permissions.View, self.context):
            return False
        return True
858500
def has_permissions(self):
        
        perms = self.request('/me/permissions')['data'][0].keys()
        return all(k in perms for k in app.config[
            'CANVAS_SCOPE'].split(','))
1026327
def has_permission(self, request):
        
        if not super(AdminSiteOTPRequiredMixin, self).has_permission(request):
            return False
        return request.user.is_verified()
620833
private boolean isPermissionCheckingEnabled(INode[] pathNodes) {
    if (this.isPermissionEnabled) {
      if (permissionEnabled == null) {
        return false;
      }
      for (INode enableDir : this.permissionEnabled) {
        for (INode pathNode : pathNodes) {
          if (pathNode == enableDir) {
            return true;
          }
        }
      }
      return false;
    }
    return false;
  }