Skip to content

Commit

Permalink
Added security for Category agents and fixed agent configuration. #56
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelProminic committed Jun 13, 2024
1 parent ed0f3f5 commit 8eeac0b
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ agent_name=CategoryCreate
# The main class that should be run for this agent. This must include the package. The maximum length is 65 characters - additional characters will be cut off.
javaproject_class=CategoryAgents/CategoryCreate.class
# The JAR to use for this agent. All agents will use the combined JAR
$$jarSourceFile=./build/libs/Super.Human.Portal_DVE_JavaAgents.jar
$$jarSourceFile=./build/libs/Super.Human.Portal_Agents.jar
# Comma-separated list of Script Libraries required for this agent
$$scriptLibrary=Moonshine-Domino-CRUD

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ agent_name=CategoryDelete
# The main class that should be run for this agent. This must include the package. The maximum length is 65 characters - additional characters will be cut off.
javaproject_class=CategoryAgents/CategoryDelete.class
# The JAR to use for this agent. All agents will use the combined JAR
$$jarSourceFile=./build/libs/Super.Human.Portal_DVE_JavaAgents.jar
$$jarSourceFile=./build/libs/Super.Human.Portal_Agents.jar
# Comma-separated list of Script Libraries required for this agent
$$scriptLibrary=Moonshine-Domino-CRUD

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ agent_name=CategoryRead
# The main class that should be run for this agent. This must include the package. The maximum length is 65 characters - additional characters will be cut off.
javaproject_class=CategoryAgents/CategoryRead.class
# The JAR to use for this agent. All agents will use the combined JAR
$$jarSourceFile=./build/libs/Super.Human.Portal_DVE_JavaAgents.jar
$$jarSourceFile=./build/libs/Super.Human.Portal_Agents.jar
# Comma-separated list of Script Libraries required for this agent
$$scriptLibrary=Moonshine-Domino-CRUD

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ agent_name=CategoryUpdate
# The main class that should be run for this agent. This must include the package. The maximum length is 65 characters - additional characters will be cut off.
javaproject_class=CategoryAgents/CategoryUpdate.class
# The JAR to use for this agent. All agents will use the combined JAR
$$jarSourceFile=./build/libs/Super.Human.Portal_DVE_JavaAgents.jar
$$jarSourceFile=./build/libs/Super.Human.Portal_Agents.jar
# Comma-separated list of Script Libraries required for this agent
$$scriptLibrary=Moonshine-Domino-CRUD

Expand Down
2 changes: 1 addition & 1 deletion Super.Human.Portal_Agents/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
notesInstallation=/Applications/HCL Notes.app/Contents/MacOS/
server=demo/DEMO
server=demo.startcloud.com/STARTcloud
dbName=SuperHumanPortal.nsf
agentPropertiesDir=agentProperties/
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
package CategoryAgents;

import java.util.Collection;

import com.moonshine.domino.security.SecurityInterface;

import auth.RoleRestrictedAgent;
import auth.SecurityBuilder;
import auth.SimpleRoleSecurity;

/**
* Modify this class for custom changes to the agent.
*/
public class CategoryCreate extends CategoryCreateBase {

// No modifications by default
public class CategoryCreate extends CategoryCreateBase implements RoleRestrictedAgent {

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
}

public SecurityInterface checkSecurity() {
return getSecurity();
}

@Override
protected SecurityInterface createSecurityInterface() {
return SecurityBuilder.buildInstance(agentDatabase, this, session, getLog());
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
package CategoryAgents;

import java.util.Collection;

import com.moonshine.domino.security.SecurityInterface;

import auth.RoleRestrictedAgent;
import auth.SecurityBuilder;
import auth.SimpleRoleSecurity;

/**
* Modify this class for custom changes to the agent.
*/
public class CategoryDelete extends CategoryDeleteBase {

// No modifications by default
public class CategoryDelete extends CategoryDeleteBase implements RoleRestrictedAgent {

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
}

public SecurityInterface checkSecurity() {
return getSecurity();
}

@Override
protected SecurityInterface createSecurityInterface() {
return SecurityBuilder.buildInstance(agentDatabase, this, session, getLog());
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
package CategoryAgents;

import java.util.Collection;

import com.moonshine.domino.security.SecurityInterface;

import auth.RoleRestrictedAgent;
import auth.SecurityBuilder;
import auth.SimpleRoleSecurity;
import lotus.domino.NotesException;
import lotus.domino.View;

/**
* Modify this class for custom changes to the agent.
*/
public class CategoryRead extends CategoryReadBase {

// No modifications by default
public class CategoryRead extends CategoryReadBase implements RoleRestrictedAgent {

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
}

public SecurityInterface checkSecurity() {
return getSecurity();
}

@Override
protected SecurityInterface createSecurityInterface() {
return SecurityBuilder.buildInstance(agentDatabase, this, session, getLog());
}


@Override
protected View getLookupView() throws NotesException {
return agentDatabase.getView("Categories/Ordered"); // use sorting
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
package CategoryAgents;

import java.util.Collection;

import com.moonshine.domino.security.SecurityInterface;

import auth.RoleRestrictedAgent;
import auth.SecurityBuilder;
import auth.SimpleRoleSecurity;

/**
* Modify this class for custom changes to the agent.
*/
public class CategoryUpdate extends CategoryUpdateBase {

// No modifications by default
public class CategoryUpdate extends CategoryUpdateBase implements RoleRestrictedAgent {

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
}

public SecurityInterface checkSecurity() {
return getSecurity();
}

@Override
protected SecurityInterface createSecurityInterface() {
return SecurityBuilder.buildInstance(agentDatabase, this, session, getLog());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.moonshine.domino.security.SecurityInterface
import com.moonshine.domino.log.DefaultLogInterface;

import config.*;
import CategoryAgents.*;
import CustomBookmarkAgents.*;
import DocumentationFormAgents.*;
import genesis.*;
Expand Down Expand Up @@ -160,6 +161,10 @@ class SimpleRoleSecuritySpec extends Specification {
new DocumentationFormDelete() | ['All']
new DocumentationFormCreate() | ['All']
new DocumentationFormUpdate() | ['All']
new CategoryRead() | ['All']
new CategoryDelete() | ['All']
new CategoryCreate() | ['All']
new CategoryUpdate() | ['All']
new CustomBookmarkDelete() | ['Administrator']
new CustomBookmarkCreate() | ['Administrator']
new CustomBookmarkUpdate() | ['Administrator']
Expand Down

0 comments on commit 8eeac0b

Please sign in to comment.