Changeset 296


Ignore:
Timestamp:
Jan 25, 2010, 10:58:29 AM (14 years ago)
Author:
gav
Message:

Add some manager and user authorities to base data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/CreateDataService.groovy

    r294 r296  
    154154
    155155        // Authority #2
    156         authInstance = new Authority(description:"Business manager, grants full management access.",
     156        authInstance = new Authority(description:"Business Manager, grants full management access.",
    157157                                        authority:"ROLE_Manager")
    158158        saveAndTest(authInstance)
     
    161161        authInstance = new Authority(description:"Application User, all application users need this base role to allow login.",
    162162                                        authority:"ROLE_AppUser")
     163        saveAndTest(authInstance)
     164
     165        // Authority #4
     166        authInstance = new Authority(description:"Task Manager",
     167                                        authority:"ROLE_TaskManager")
     168        saveAndTest(authInstance)
     169
     170        // Authority #5
     171        authInstance = new Authority(description:"Task User",
     172                                        authority:"ROLE_TaskUser")
     173        saveAndTest(authInstance)
     174
     175        // Authority #6
     176        authInstance = new Authority(description:"Inventory Manager",
     177                                        authority:"ROLE_InventoryManager")
     178        saveAndTest(authInstance)
     179
     180        // Authority #7
     181        authInstance = new Authority(description:"Inventory User",
     182                                        authority:"ROLE_InvetoryUser")
     183        saveAndTest(authInstance)
     184
     185        // Authority #8
     186        authInstance = new Authority(description:"Asset Manager",
     187                                        authority:"ROLE_AssetManager")
     188        saveAndTest(authInstance)
     189
     190        // Authority #9
     191        authInstance = new Authority(description:"Asset User",
     192                                        authority:"ROLE_AssetUser")
    163193        saveAndTest(authInstance)
    164194    }
     
    263293        saveAndTest(personInstance)
    264294        personInstance.addToAuthorities(Authority.get(3))
     295        personInstance.addToAuthorities(Authority.get(5))
     296        personInstance.addToAuthorities(Authority.get(7))
     297        personInstance.addToAuthorities(Authority.get(9))
    265298        personInstance.addToPersonGroups(PersonGroup.get(1))
    266299
     
    274307        saveAndTest(personInstance)
    275308        personInstance.addToAuthorities(Authority.get(3))
     309        personInstance.addToAuthorities(Authority.get(5))
     310        personInstance.addToAuthorities(Authority.get(7))
     311        personInstance.addToAuthorities(Authority.get(9))
    276312        personInstance.addToPersonGroups(PersonGroup.get(1))
    277313
     
    285321        saveAndTest(personInstance)
    286322        personInstance.addToAuthorities(Authority.get(3))
     323        personInstance.addToAuthorities(Authority.get(5))
     324        personInstance.addToAuthorities(Authority.get(7))
     325        personInstance.addToAuthorities(Authority.get(9))
    287326        personInstance.addToPersonGroups(PersonGroup.get(2))
    288327
     
    296335        saveAndTest(personInstance)
    297336        personInstance.addToAuthorities(Authority.get(3))
     337        personInstance.addToAuthorities(Authority.get(5))
     338        personInstance.addToPersonGroups(PersonGroup.get(3))
     339
     340        //Person #7
     341        personInstance = new Person(loginName:"testmanager",
     342                                    firstName:"Test",
     343                                    lastName:"Manager",
     344                                    pass:passClearText,
     345                                    password:passwordEncoded,
     346                                    email:"user@example.com")
     347        saveAndTest(personInstance)
     348        personInstance.addToAuthorities(Authority.get(3))
     349        personInstance.addToAuthorities(Authority.get(4))
     350        personInstance.addToAuthorities(Authority.get(6))
     351        personInstance.addToAuthorities(Authority.get(8))
    298352        personInstance.addToPersonGroups(PersonGroup.get(3))
    299353    }
Note: See TracChangeset for help on using the changeset viewer.