Skip to content

Commit

Permalink
Add annotation for create app, key
Browse files Browse the repository at this point in the history
  • Loading branch information
sbearcsiro committed Jul 28, 2022
1 parent f796ae2 commit ace0387
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions grails-app/controllers/apikey/AppController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import au.org.ala.web.AlaSecured
import au.org.ala.web.CASRoles
import au.org.ala.web.SSO

import javax.transaction.Transactional

class AppController {

LocalAuthService localAuthService
Expand All @@ -27,6 +29,7 @@ class AppController {

@SSO
@AlaSecured(value = CASRoles.ROLE_ADMIN, statusCode = 403)
@Transactional
def addAnApp() {
def result = App.findByName(params.name)
if (!result) {
Expand Down
3 changes: 3 additions & 0 deletions grails-app/controllers/apikey/GetKeyController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ package apikey
import au.org.ala.web.AlaSecured
import au.org.ala.web.CASRoles

import javax.transaction.Transactional

class GetKeyController {

def index() { }

LocalAuthService localAuthService

@AlaSecured(value = CASRoles.ROLE_ADMIN, statusCode = 403, view = '/getKey/notCreated')
@Transactional
def submit() {
final userDetails = localAuthService.userDetails()
final userId = userDetails[1]
Expand Down

0 comments on commit ace0387

Please sign in to comment.