File tree Expand file tree Collapse file tree 4 files changed +16
-12
lines changed
Expand file tree Collapse file tree 4 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -1139,4 +1139,10 @@ describe('API authz tests', () => {
11391139 await agent . post ( '/alpha/teams/team1/agents' ) . send ( agentData ) . expect ( 401 )
11401140 } )
11411141 } )
1142+ test ( 'team member cannot access settings' , async ( ) => {
1143+ await agent . get ( '/v1/settings' ) . set ( 'Authorization' , `Bearer ${ teamMemberToken } ` ) . expect ( 403 )
1144+ } )
1145+ test ( 'team admin cannot access settings' , async ( ) => {
1146+ await agent . get ( '/v1/settings' ) . set ( 'Authorization' , `Bearer ${ teamAdminToken } ` ) . expect ( 403 )
1147+ } )
11421148} )
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ const debug = Debug('otomi:api:v1:dashboard')
99 * Get dashboard information
1010 */
1111export const getDashboard = ( req : OpenApiRequestExt , res : Response ) : void => {
12- const { teamName } = req . query
13- debug ( `getDashboard(${ teamName } )` )
14- const v = req . otomi . getDashboard ( teamName as string )
12+ const { teamId } = req . query
13+ debug ( `getDashboard(${ teamId } )` )
14+ const v = req . otomi . getDashboard ( teamId as string )
1515 res . json ( v )
1616}
Original file line number Diff line number Diff line change 11Settings :
22 x-acl :
33 platformAdmin : [read-any, update-any]
4- teamAdmin : [read]
5- teamMember : [read]
64 additionalProperties : false
75 properties :
86 alerts :
Original file line number Diff line number Diff line change @@ -1278,13 +1278,13 @@ export default class OtomiStack {
12781278 return internalRepoUrls
12791279 }
12801280
1281- getDashboard ( teamName : string ) : Array < any > {
1282- const codeRepos = teamName ? this . getTeamAplCodeRepos ( teamName ) : this . getAllCodeRepos ( )
1283- const builds = teamName ? this . getTeamAplBuilds ( teamName ) : this . getAllBuilds ( )
1284- const workloads = teamName ? this . getTeamAplWorkloads ( teamName ) : this . getAllWorkloads ( )
1285- const services = teamName ? this . getTeamAplServices ( teamName ) : this . getAllServices ( )
1286- const secrets = teamName ? this . getAplSealedSecrets ( teamName ) : this . getAllAplSealedSecrets ( )
1287- const netpols = teamName ? this . getTeamAplNetpols ( teamName ) : this . getAllNetpols ( )
1281+ getDashboard ( teamId : string ) : Array < any > {
1282+ const codeRepos = teamId ? this . getTeamAplCodeRepos ( teamId ) : this . getAllCodeRepos ( )
1283+ const builds = teamId ? this . getTeamAplBuilds ( teamId ) : this . getAllBuilds ( )
1284+ const workloads = teamId ? this . getTeamAplWorkloads ( teamId ) : this . getAllWorkloads ( )
1285+ const services = teamId ? this . getTeamAplServices ( teamId ) : this . getAllServices ( )
1286+ const secrets = teamId ? this . getAplSealedSecrets ( teamId ) : this . getAllAplSealedSecrets ( )
1287+ const netpols = teamId ? this . getTeamAplNetpols ( teamId ) : this . getAllNetpols ( )
12881288
12891289 return [
12901290 { name : 'code-repositories' , count : codeRepos ?. length } ,
You can’t perform that action at this time.
0 commit comments