Search in sources :

Example 1 with UserGroup

use of org.eclipse.sw360.datahandler.thrift.users.UserGroup in project sw360portal by sw360.

the class WhenComputePermissions method the_highest_allowed_action_is_computed_for_user_$_with_user_group_$_and_department_$.

public WhenComputePermissions the_highest_allowed_action_is_computed_for_user_$_with_user_group_$_and_department_$(@Quoted String userEmail, @TEnumToString UserGroup userGroup, @Quoted String userDept) {
    final User user = new User(DUMMY_ID, userEmail, userDept).setUserGroup(userGroup);
    final DocumentPermissions<Project> projectDocumentPermissions = PermissionUtils.makePermission(project, user);
    allowedActions = projectDocumentPermissions.getAllAllowedActions();
    return self();
}
Also used : Project(org.eclipse.sw360.datahandler.thrift.projects.Project) User(org.eclipse.sw360.datahandler.thrift.users.User)

Example 2 with UserGroup

use of org.eclipse.sw360.datahandler.thrift.users.UserGroup in project sw360portal by sw360.

the class WhenComputeVisibility method the_visibility_is_computed_for_department_$_and_user_group_$.

public WhenComputeVisibility the_visibility_is_computed_for_department_$_and_user_group_$(@Quoted String department, @TEnumToString UserGroup userGroup) {
    final User user = new User(DUMMY_ID, DUMMY_MAIL, department).setUserGroup(userGroup);
    isVisible = ProjectPermissions.isVisible(user).test(project);
    return self();
}
Also used : User(org.eclipse.sw360.datahandler.thrift.users.User)

Aggregations

User (org.eclipse.sw360.datahandler.thrift.users.User)2 Project (org.eclipse.sw360.datahandler.thrift.projects.Project)1