-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#28: add static role names and automatic role adder
- Loading branch information
1 parent
5c409e1
commit f51ba58
Showing
16 changed files
with
332 additions
and
9 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
admin-tools-core/src/main/java/de/chandre/admintool/core/sec/AdminToolCoreRoles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package de.chandre.admintool.core.sec; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import de.chandre.admintool.core.sec.AdminToolRoles; | ||
|
||
/** | ||
* | ||
* @author Andre | ||
* @since 1.2.0 | ||
*/ | ||
@Component | ||
public class AdminToolCoreRoles implements AdminToolRoles { | ||
|
||
public static String ROLE_ATCORE = "ATCORE"; | ||
|
||
@Override | ||
public Collection<String> getRoles() { | ||
return Collections.unmodifiableList(Arrays.asList(ROLE_ATCORE)); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
admin-tools-core/src/main/java/de/chandre/admintool/core/sec/AdminToolRoles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package de.chandre.admintool.core.sec; | ||
|
||
import java.util.Collection; | ||
|
||
/** | ||
* interface for roles of a admintool component | ||
* (placed in core to avoid interdependencies) | ||
* @author Andre | ||
* @since 1.2.0 | ||
*/ | ||
public interface AdminToolRoles { | ||
|
||
Collection<String> getRoles(); | ||
} |
26 changes: 26 additions & 0 deletions
26
admin-tools-dbbrowser/src/main/java/de/chandre/admintool/db/AdminToolDBBrowserRoles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package de.chandre.admintool.db; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import de.chandre.admintool.core.sec.AdminToolRoles; | ||
|
||
/** | ||
* | ||
* @author Andre | ||
* @since 1.2.0 | ||
*/ | ||
@Component | ||
public class AdminToolDBBrowserRoles implements AdminToolRoles { | ||
|
||
public static String ROLE_DBBROWSER = "DBBROWSER"; | ||
|
||
@Override | ||
public Collection<String> getRoles() { | ||
return Collections.unmodifiableList(Arrays.asList(ROLE_DBBROWSER)); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
...filebrowser/src/main/java/de/chandre/admintool/filebrowser/AdminToolFileBrowserRoles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package de.chandre.admintool.filebrowser; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import de.chandre.admintool.core.sec.AdminToolRoles; | ||
|
||
/** | ||
* | ||
* @author Andre | ||
* @since 1.2.0 | ||
*/ | ||
@Component | ||
public class AdminToolFileBrowserRoles implements AdminToolRoles { | ||
|
||
public static String ROLE_FILEBROWSER = "FILEBROWSER"; | ||
|
||
@Override | ||
public Collection<String> getRoles() { | ||
return Collections.unmodifiableList(Arrays.asList(ROLE_FILEBROWSER)); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
...s-filebrowser/src/main/java/de/chandre/admintool/fileviewer/AdminToolFileViewerRoles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package de.chandre.admintool.fileviewer; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import de.chandre.admintool.core.sec.AdminToolRoles; | ||
|
||
/** | ||
* | ||
* @author Andre | ||
* @since 1.2.0 | ||
*/ | ||
@Component | ||
public class AdminToolFileViewerRoles implements AdminToolRoles { | ||
|
||
public static String ROLE_FILEVIEWER = "FILEVIEWER"; | ||
|
||
@Override | ||
public Collection<String> getRoles() { | ||
return Collections.unmodifiableList(Arrays.asList(ROLE_FILEVIEWER)); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
admin-tools-jminix/src/main/java/de/chandre/admintool/jminix/AdminToolJmxRoles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package de.chandre.admintool.jminix; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import de.chandre.admintool.core.sec.AdminToolRoles; | ||
|
||
/** | ||
* | ||
* @author Andre | ||
* @since 1.2.0 | ||
*/ | ||
@Component | ||
public class AdminToolJmxRoles implements AdminToolRoles { | ||
|
||
public static String ROLE_JMX = "JMX"; | ||
|
||
@Override | ||
public Collection<String> getRoles() { | ||
return Collections.unmodifiableList(Arrays.asList(ROLE_JMX)); | ||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
admin-tools-log4j2/src/main/java/de/chandre/admintool/log4j2/AdminToolLog4jRoles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package de.chandre.admintool.log4j2; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import de.chandre.admintool.core.sec.AdminToolRoles; | ||
|
||
/** | ||
* | ||
* @author Andre | ||
* @since 1.2.0 | ||
*/ | ||
@Component | ||
public class AdminToolLog4jRoles implements AdminToolRoles { | ||
|
||
public static String ROLE_LOG4J = "LOG4J"; | ||
|
||
public static String ROLE_LOG4J_LOGGERS = "LOG4J_LOGGERS"; | ||
public static String ROLE_LOG4J_CONSOLE = "LOG4J_CONSOLE"; | ||
|
||
@Override | ||
public Collection<String> getRoles() { | ||
return Collections.unmodifiableList(Arrays.asList(ROLE_LOG4J, ROLE_LOG4J_LOGGERS, ROLE_LOG4J_CONSOLE)); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
admin-tools-melody/src/main/java/de/chandre/admintool/melody/AdminToolMelodyRoles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package de.chandre.admintool.melody; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import de.chandre.admintool.core.sec.AdminToolRoles; | ||
|
||
/** | ||
* | ||
* @author Andre | ||
* @since 1.2.0 | ||
*/ | ||
@Component | ||
public class AdminToolMelodyRoles implements AdminToolRoles { | ||
|
||
public static String ROLE_MELODY = "MELODY"; | ||
|
||
@Override | ||
public Collection<String> getRoles() { | ||
return Collections.unmodifiableList(Arrays.asList(ROLE_MELODY)); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
...ls-properties/src/main/java/de/chandre/admintool/properties/AdminToolPropertiesRoles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package de.chandre.admintool.properties; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import de.chandre.admintool.core.sec.AdminToolRoles; | ||
|
||
/** | ||
* | ||
* @author Andre | ||
* @since 1.2.0 | ||
*/ | ||
@Component | ||
public class AdminToolPropertiesRoles implements AdminToolRoles { | ||
|
||
public static String ROLE_PROPS = "PROPS"; | ||
|
||
@Override | ||
public Collection<String> getRoles() { | ||
return Collections.unmodifiableList(Arrays.asList(ROLE_PROPS)); | ||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
admin-tools-quartz/src/main/java/de/chandre/admintool/quartz/AdminToolQuartzRoles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package de.chandre.admintool.quartz; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import de.chandre.admintool.core.sec.AdminToolRoles; | ||
|
||
/** | ||
* | ||
* @author Andre | ||
* @since 1.2.0 | ||
*/ | ||
@Component | ||
public class AdminToolQuartzRoles implements AdminToolRoles { | ||
|
||
public static String ROLE_QUARTZ = "QUARTZ"; | ||
|
||
public static String ROLE_QUARTZ_CONFIG = "QUARTZ_CONFIG"; | ||
public static String ROLE_QUARTZ_JOBS = "QUARTZ_JOBS"; | ||
|
||
@Override | ||
public Collection<String> getRoles() { | ||
return Collections.unmodifiableList(Arrays.asList(ROLE_QUARTZ, ROLE_QUARTZ_CONFIG, ROLE_QUARTZ_JOBS)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...curity-dbuser/src/main/java/de/chandre/admintool/security/dbuser/AdminToolSecDBRoles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package de.chandre.admintool.security.dbuser; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import de.chandre.admintool.core.sec.AdminToolRoles; | ||
|
||
/** | ||
* | ||
* @author Andre | ||
* @since 1.2.0 | ||
*/ | ||
@Component | ||
public class AdminToolSecDBRoles implements AdminToolRoles { | ||
|
||
public static String ROLE_CLIENT = "CLIENT"; | ||
public static String ROLE_ROLES = "ROLES"; | ||
public static String ROLE_USERS = "USERS"; | ||
public static String ROLE_GROUPS = "GROUPS"; | ||
public static String ROLE_ACCMGMT = "ACCMGMT"; | ||
|
||
@Override | ||
public Collection<String> getRoles() { | ||
return Collections.unmodifiableList(Arrays.asList(ROLE_CLIENT, ROLE_ROLES, ROLE_USERS, ROLE_GROUPS, ROLE_ACCMGMT)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.