Skip to content

Commit

Permalink
feat(admin-ui): provide roles and permissions management screens in A…
Browse files Browse the repository at this point in the history
…dmin UI #339
  • Loading branch information
syntrydy committed Jan 10, 2022
1 parent f36d313 commit 18e72e2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
3 changes: 0 additions & 3 deletions app/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ export const RoutedContent = () => {
const scopes = useSelector((state) =>
state.token ? state.token.scopes : state.authReducer.permissions,
)
console.log("###############################################")
console.log("#####"+JSON.stringify(scopes))
console.log("###############################################")
const [pluginMenus, setPluginMenus] = useState([])
useEffect(() => {
setPluginMenus(processRoutes())
Expand Down
11 changes: 9 additions & 2 deletions app/utils/PermChecker.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@ export const PERMISSION_WRITE =
export const PERMISSION_DELETE =
'https://jans.io/oauth/jans-auth-server/config/adminui/user/permission.delete'

export const LICENSE_DETAILS_READ = BASE_URL + '/config/adminui/license.readonly'
export const MAPPING_READ =
'https://jans.io/oauth/jans-auth-server/config/adminui/user/rolePermissionMapping.readonly'
export const MAPPING_WRITE =
'https://jans.io/oauth/jans-auth-server/config/adminui/user/rolePermissionMapping.write'
export const MAPPING_DELETE =
'https://jans.io/oauth/jans-auth-server/config/adminui/user/rolePermissionMapping.write'

export const LICENSE_DETAILS_READ =
BASE_URL + '/config/adminui/license.readonly'
export const LICENSE_DETAILS_WRITE = BASE_URL + '/config/adminui/license.write'


export const SCOPE_READ = BASE_URL + '/config/scopes.readonly'
export const SCOPE_WRITE = BASE_URL + '/config/scopes.write'
export const SCOPE_DELETE = BASE_URL + '/config/scopes.delete'
Expand Down
7 changes: 4 additions & 3 deletions plugins/admin/plugin-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
PERMISSION_READ,
SCRIPT_READ,
SCRIPT_WRITE,
MAPPING_READ,
} from '../../app/utils/PermChecker'

const PLUGIN_BASE_APTH = '/adm'
Expand Down Expand Up @@ -60,12 +61,12 @@ const pluginMetadata = {
{
title: 'menus.api.permissions',
path: PLUGIN_BASE_APTH + '/permissions',
permission: ACR_READ,
permission: PERMISSION_READ,
},
{
title: 'menus.api.mapping',
path: PLUGIN_BASE_APTH + '/mapping',
permission: ACR_READ,
permission: MAPPING_READ,
},
],
},
Expand Down Expand Up @@ -111,7 +112,7 @@ const pluginMetadata = {
{
component: MappingPage,
path: PLUGIN_BASE_APTH + '/mapping',
permission: PERMISSION_READ,
permission: MAPPING_READ,
},
{
component: ScriptListPage,
Expand Down

0 comments on commit 18e72e2

Please sign in to comment.