use of org.sonar.db.permission.UserPermissionDto in project sonarqube by SonarSource.
the class UserDbTester method insertProjectPermissionOnUser.
/**
* Grant permission on given project
*/
public UserPermissionDto insertProjectPermissionOnUser(UserDto user, String permission, ComponentDto project) {
UserPermissionDto dto = new UserPermissionDto(project.getOrganizationUuid(), permission, user.getId(), project.getId());
db.getDbClient().userPermissionDao().insert(db.getSession(), dto);
db.commit();
return dto;
}
use of org.sonar.db.permission.UserPermissionDto in project sonarqube by SonarSource.
the class UserDbTester method insertPermissionOnUser.
/**
* Grant global permission
* @deprecated use {@link #insertPermissionOnUser(OrganizationDto, UserDto, OrganizationPermission)}
*/
@Deprecated
public UserPermissionDto insertPermissionOnUser(OrganizationDto org, UserDto user, String permission) {
UserPermissionDto dto = new UserPermissionDto(org.getUuid(), permission, user.getId(), null);
db.getDbClient().userPermissionDao().insert(db.getSession(), dto);
db.commit();
return dto;
}
use of org.sonar.db.permission.UserPermissionDto in project sonarqube by SonarSource.
the class ListActionTest method addComponent.
private ComponentDto addComponent(ComponentDto component) {
db.components().insertComponent(component);
dbClient.userPermissionDao().insert(dbSession, new UserPermissionDto(component.getOrganizationUuid(), UserRole.USER, userSession.getUserId(), component.getId()));
db.commit();
return component;
}
Aggregations