import com.onresolve.scriptrunner.runner.customisers.PluginModule;
import com.onresolve.scriptrunner.runner.customisers.WithPlugin;
import org.everit.jira.reporting.service.permission.PermissionService;
import org.everit.jira.reporting.service.permission.PermissionType;
import org.everit.jira.reporting.service.permission.GroupUser;
import java.util.Arrays;
@WithPlugin("org.everit.jira.timetracker.plugin")
@PluginModule
PermissionService permissionService;
log.error("BEYOND_PERIOD: " + permissionService.getGroupUserByPermissionType(PermissionType.BEYOND_PERIOD));
log.error("BROWSE_GROUPS: " + permissionService.getGroupUserByPermissionType(PermissionType.BROWSE_GROUPS));
log.error("EMAIL_GROUPS: " + permissionService.getGroupUserByPermissionType(PermissionType.EMAIL_GROUPS));
log.error("PLUGIN_PERMISSION: " + permissionService.getGroupUserByPermissionType(PermissionType.PLUGIN_PERMISSION));
log.error("REPORTING_PERMISSION: " + permissionService.getGroupUserByPermissionType(PermissionType.REPORTING_PERMISSION));
log.error("TIMETRACKER_PERMISSION: " + permissionService.getGroupUserByPermissionType(PermissionType.TIMETRACKER_PERMISSION));
log.error("WAGE_MANAGER: " + permissionService.getGroupUserByPermissionType(PermissionType.WAGE_MANAGER));
log.error("PROJECT_CONTROLLER: " + permissionService.getGroupUserByPermissionType(PermissionType.PROJECT_CONTROLLER));
GroupUser groupUser = new GroupUser();
permissionService.updatePermission(PermissionType.BEYOND_PERIOD, groupUser);
log.error("BEYOND_PERIOD: " + permissionService.getGroupUserByPermissionType(PermissionType.BEYOND_PERIOD));
groupUser = new GroupUser()
.setGroups(Arrays.asList("jira-administrators"))
.setUsers(Arrays.asList("douglas.arnold@everit.biz"));
permissionService.updatePermission(PermissionType.BEYOND_PERIOD, groupUser);
log.error("BEYOND_PERIOD: " + permissionService.getGroupUserByPermissionType(PermissionType.BEYOND_PERIOD)); |