Skip to content

Commit

Permalink
Jira issue 124: SND - Add new security roles and permissions for cont…
Browse files Browse the repository at this point in the history
…rolling access to UI (#213)
  • Loading branch information
spamhurts authored Aug 7, 2024
1 parent 3424fcd commit ce6f254
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/org/labkey/snd/SNDModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@
import org.labkey.snd.security.roles.SNDBasicSubmitterRole;
import org.labkey.snd.security.roles.SNDDataAdminRole;
import org.labkey.snd.security.roles.SNDDataReviewerRole;
import org.labkey.snd.security.roles.SNDEditorRole;
import org.labkey.snd.security.roles.SNDPackageEditorRole;
import org.labkey.snd.security.roles.SNDPackageViewerRole;
import org.labkey.snd.security.roles.SNDProjectEditorRole;
import org.labkey.snd.security.roles.SNDProjectViewerRole;
import org.labkey.snd.security.roles.SNDReaderRole;
import org.labkey.snd.security.roles.SNDViewerRole;

import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -97,6 +99,8 @@ protected void init()
RoleManager.registerRole(new SNDPackageEditorRole(), true);
RoleManager.registerRole(new SNDProjectViewerRole(), true);
RoleManager.registerRole(new SNDProjectEditorRole(), true);
RoleManager.registerRole(new SNDViewerRole(), true);
RoleManager.registerRole(new SNDEditorRole(), true);

}

Expand Down
16 changes: 16 additions & 0 deletions src/org/labkey/snd/security/permissions/SNDEditorPermission.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.labkey.snd.security.permissions;

import org.labkey.api.security.permissions.AbstractPermission;


/**
* Created by thawkins on 8/6/2024.
*/
public class SNDEditorPermission extends AbstractPermission
{
public SNDEditorPermission()
{
super("SNDEditorPermission", "This is the base permission required to Edit SND Data.");
}

}
16 changes: 16 additions & 0 deletions src/org/labkey/snd/security/permissions/SNDViewerPermission.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.labkey.snd.security.permissions;

import org.labkey.api.security.permissions.AbstractPermission;


/**
* Created by thawkins on 8/6/2024.
*/
public class SNDViewerPermission extends AbstractPermission
{
public SNDViewerPermission()
{
super("SNDViewerPermission", "This is the base permission required to view SND Data.");
}

}
23 changes: 23 additions & 0 deletions src/org/labkey/snd/security/roles/SNDEditorRole.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.labkey.snd.security.roles;

import org.labkey.api.security.roles.AbstractModuleScopedRole;
import org.labkey.snd.SNDModule;
import org.labkey.snd.security.permissions.SNDEditorPermission;
import org.labkey.snd.security.permissions.SNDViewerPermission;

/**
* Created by thawkins on 8/6/2024.
*/
public class SNDEditorRole extends AbstractModuleScopedRole
{
public SNDEditorRole()
{
super("SND Data Editors", "Users with this role are permitted to Edit SND data.",
SNDModule.class,
SNDViewerPermission.class,
SNDEditorPermission.class
);


}
}
21 changes: 21 additions & 0 deletions src/org/labkey/snd/security/roles/SNDViewerRole.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.labkey.snd.security.roles;

import org.labkey.api.security.roles.AbstractModuleScopedRole;
import org.labkey.snd.SNDModule;
import org.labkey.snd.security.permissions.SNDViewerPermission;

/**
* Created by thawkins on 8/6/2024.
*/
public class SNDViewerRole extends AbstractModuleScopedRole
{
public SNDViewerRole()
{
super("SND Data Viewers", "Users with this role are permitted to view SND data.",
SNDModule.class,
SNDViewerPermission.class
);


}
}

0 comments on commit ce6f254

Please sign in to comment.