use of org.sonar.db.permission.OrganizationPermission in project sonarqube by SonarSource.
the class SearchGlobalPermissionsAction method buildResponse.
private WsSearchGlobalPermissionsResponse buildResponse(DbSession dbSession, OrganizationDto org) {
WsSearchGlobalPermissionsResponse.Builder response = WsSearchGlobalPermissionsResponse.newBuilder();
Permission.Builder permission = newBuilder();
OrganizationPermission.all().map(OrganizationPermission::getKey).forEach(permissionKey -> {
PermissionQuery query = permissionQuery(permissionKey);
response.addPermissions(permission.clear().setKey(permissionKey).setName(i18nName(permissionKey)).setDescription(i18nDescriptionMessage(permissionKey)).setUsersCount(countUsers(dbSession, org, query)).setGroupsCount(countGroups(dbSession, org, permissionKey)));
});
return response.build();
}
Aggregations