Ignore:
Timestamp:
Mar 25, 2009, 4:26:43 AM (15 years ago)
Author:
gav
Message:

More detailing on Task and Entry. Added another authorisation ROLE_Manager and view to go with it. Work on PersonController? delete action.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/grails-app/controllers/PersonController.groovy

    r73 r91  
    11import org.codehaus.groovy.grails.plugins.springsecurity.Secured
    22
    3 @Secured(['ROLE_AppAdmin'])
     3@Secured(['ROLE_AppAdmin', 'ROLE_Manager'])
    44class PersonController {
    55
     
    5353                                //first, delete this person from Persons_Authorities table.
    5454                                Authority.findAll().each { it.removeFromPersons(person) }
    55                                 person.delete()
    56                                 flash.message = "Person $params.id deleted."
     55               
     56//                 try {
     57                    person.delete(flush:true)
     58                    flash.message = "Person $params.id deleted."
     59//                 }
     60//                 catch(Exception e) {
     61//                     flash.message = "Could not delete '$person.loginName' due to database constraints, but all authorities have been removed."
     62//                     redirect action: edit, id: person.id
     63//                 }
     64
    5765                        }
    5866                }
Note: See TracChangeset for help on using the changeset viewer.