/** * Used by license notifications */ public List<String> selectGlobalAdministratorLogins(DbSession dbSession) { return mapper(dbSession).selectLoginsWithGlobalPermission(ADMINISTER.getKey()); }
/** * The number of users who will still have the permission if the permission {@code permission} * is removed from user {@code userId}. The anyone virtual group is not taken into account. * Contrary to {@link #countUsersWithGlobalPermissionExcludingUser(DbSession, String, String, int)}, user * still exists and may have the permission through groups. */ public int countUsersWithGlobalPermissionExcludingUserPermission(DbSession dbSession, String organizationUuid, String permission, int userId) { return mapper(dbSession).countUsersWithGlobalPermissionExcludingUserPermission(organizationUuid, permission, userId); }
/** * Gets all the global permissions granted to user for the specified organization. * * @return the global permissions. An empty list is returned if user or organization do not exist. */ public List<String> selectGlobalPermissionsOfUser(DbSession dbSession, int userId, String organizationUuid) { return mapper(dbSession).selectGlobalPermissionsOfUser(userId, organizationUuid); }
/** * Removes a single global permission from user */ public void deleteGlobalPermission(DbSession dbSession, int userId, String permission, String organizationUuid) { mapper(dbSession).deleteGlobalPermission(userId, permission, organizationUuid); }
/** * Gets all the project permissions granted to user for the specified project. * * @return the project permissions. An empty list is returned if project or user do not exist. */ public List<String> selectProjectPermissionsOfUser(DbSession dbSession, int userId, long projectId) { return mapper(dbSession).selectProjectPermissionsOfUser(userId, projectId); }
/** * Removes a single project permission from user */ public void deleteProjectPermission(DbSession dbSession, int userId, String permission, long projectId) { mapper(dbSession).deleteProjectPermission(userId, permission, projectId); }
/** * Deletes all the permissions defined on a project */ public void deleteProjectPermissions(DbSession dbSession, long projectId) { mapper(dbSession).deleteProjectPermissions(projectId); }
/** * Loads all the permissions granted to anonymous user for the specified organization */ public Set<String> selectOrganizationPermissionsOfAnonymous(DbSession dbSession, String organizationUuid) { return mapper(dbSession).selectOrganizationPermissionsOfAnonymous(organizationUuid); }
/** * The number of users who will still have the permission if the user {@code excludedUserId} * is deleted. The anyone virtual group is not taken into account. */ public int countUsersWithGlobalPermissionExcludingUser(DbSession dbSession, String organizationUuid, String permission, int excludedUserId) { return mapper(dbSession).countUsersWithGlobalPermissionExcludingUser(organizationUuid, permission, excludedUserId); }
/** * Count the number of groups returned by {@link #selectGroupNamesByQuery(DbSession, PermissionQuery)}, * without applying pagination. */ public int countGroupsByQuery(DbSession dbSession, PermissionQuery query) { return mapper(dbSession).countGroupsByQuery(query); }
/** * Loads all the permissions granted to logged-in user for the specified organization */ public Set<String> selectOrganizationPermissions(DbSession dbSession, String organizationUuid, int userId) { return mapper(dbSession).selectOrganizationPermissions(organizationUuid, userId); }
/** * The number of users who will still have the permission if the group {@code excludedGroupId} * is deleted. The anyone virtual group is not taken into account. */ public int countUsersWithGlobalPermissionExcludingGroup(DbSession dbSession, String organizationUuid, String permission, int excludedGroupId) { return mapper(dbSession).countUsersWithGlobalPermissionExcludingGroup(organizationUuid, permission, excludedGroupId); }
/** * Delete all the permissions associated to a root component (project) */ public void deleteByRootComponentId(DbSession dbSession, long rootComponentId) { mapper(dbSession).deleteByRootComponentId(rootComponentId); }
/** * The number of users who will still have the permission if the user {@code userId} * is removed from group {@code groupId}. The anyone virtual group is not taken into account. * Contrary to {@link #countUsersWithGlobalPermissionExcludingUser(DbSession, String, String, int)}, user * still exists and may have the permission directly or through other groups. */ public int countUsersWithGlobalPermissionExcludingGroupMember(DbSession dbSession, String organizationUuid, String permission, int groupId, int userId) { return mapper(dbSession).countUsersWithGlobalPermissionExcludingGroupMember(organizationUuid, permission, groupId, userId); }
/** * The UUIDs of all the organizations in which the specified user has the specified global permission. An empty * set is returned if user or permission do not exist. An empty set is also returned if the user is not involved * in any organization. * <br/> * Group membership is taken into account. Anonymous privileges are ignored. */ public Set<String> selectOrganizationUuidsOfUserWithGlobalPermission(DbSession dbSession, int userId, String permission) { return mapper(dbSession).selectOrganizationUuidsOfUserWithGlobalPermission(userId, permission); }
/** * Deletes the specified permission on the specified project for any user. */ public int deleteProjectPermissionOfAnyUser(DbSession dbSession, long projectId, String permission) { return mapper(dbSession).deleteProjectPermissionOfAnyUser(projectId, permission); }
/** * Lists id of groups with at least one permission on the specified root component but which do not have the specified * permission, <strong>excluding group "AnyOne"</strong> (which implies the returned {@code Sett} can't contain * {@code null}). */ public Set<Integer> selectGroupIdsWithPermissionOnProjectBut(DbSession session, long projectId, String permission) { return mapper(session).selectGroupIdsWithPermissionOnProjectBut(projectId, permission); }
/** * Loads all the permissions granted to anonymous for the specified project <strong>stored in *_ROLES * tables</strong>. * An empty Set is returned if anonymous user has no permissions on the project. * * <strong>This method does not support public components</strong> */ public Set<String> selectProjectPermissionsOfAnonymous(DbSession dbSession, String projectUuid) { return mapper(dbSession).selectProjectPermissionsOfAnonymous(projectUuid); }
/** * Select global and project permissions of a given group (Anyone group is NOT supported) * Each row returns a {@link GroupPermissionDto} */ public void selectAllPermissionsByGroupId(DbSession dbSession, String organizationUuid, Integer groupId, ResultHandler resultHandler) { mapper(dbSession).selectAllPermissionsByGroupId(organizationUuid, groupId, resultHandler); }
/** * Delete the specified permission for the specified component for any group (including group AnyOne). */ public int deleteByRootComponentIdAndPermission(DbSession dbSession, long rootComponentId, String permission) { return mapper(dbSession).deleteByRootComponentIdAndPermission(rootComponentId, permission); }