Ignore:
Timestamp:
Mar 10, 2009, 3:00:59 AM (16 years ago)
Author:
gav
Message:

Start changing roles to AppAdmin? and AppUser?.
Add Options view, start code for user changeable passwords.
Repair home and admin bean error variables.

Location:
branches/TaskRewrite/src/grails-app
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/TaskRewrite/src/grails-app/conf/BootStrap.groovy

    r69 r71  
    6363        def authInstance
    6464
    65         authInstance = new Authority(description:"Application Admin",
    66                                         authority:"ROLE_ADMIN")
     65        authInstance = new Authority(description:"Application Admin, grants full admin access to the application.",
     66                                        authority:"ROLE_AppAdmin")
    6767        BootStrapSaveAndTest(authInstance)
    6868
    69         authInstance = new Authority(description:"Application Admin",
    70                                         authority:"ROLE_USER")
     69        authInstance = new Authority(description:"Application User, all application users need this base role.",
     70                                        authority:"ROLE_AppUser")
    7171        BootStrapSaveAndTest(authInstance)
    7272           
  • branches/TaskRewrite/src/grails-app/conf/SecurityConfig.groovy

    r69 r71  
    2020
    2121    //Set true especially if used across the internet.
    22     forceHttps = 'true'
     22    forceHttps = 'false'
    2323
    2424    //Pessimistic locking, deny access to all URLs that don't
  • branches/TaskRewrite/src/grails-app/controllers/AppCoreController.groovy

    r69 r71  
    22
    33class AppCoreController extends BaseController {
     4
     5    def authenticateService
    46
    57    def index = { redirect(action:home,params:params) }
     
    1214    }
    1315
    14     @Secured(['ROLE_ADMIN'])   
     16    def options = {
     17        def principal = authenticateService.principal()
     18        println principal.getUsername()//get username
     19        println principal.getAuthorities()//get authorities()
     20    }
     21
     22    @Secured(['ROLE_AppAdmin'])   
    1523    def admin = {
    1624    }
  • branches/TaskRewrite/src/grails-app/controllers/AuthorityController.groovy

    r62 r71  
    11import org.codehaus.groovy.grails.plugins.springsecurity.Secured
    22
    3 @Secured(['ROLE_ADMIN'])
     3@Secured(['ROLE_AppAdmin'])
    44class AuthorityController {
    55
  • branches/TaskRewrite/src/grails-app/controllers/BaseController.groovy

    r69 r71  
    11import org.codehaus.groovy.grails.plugins.springsecurity.Secured
    22
    3 @Secured(['ROLE_USER'])
     3@Secured(['ROLE_AppUser'])
    44abstract class BaseController {
    55    def whatsit() {
  • branches/TaskRewrite/src/grails-app/views/_adminmenubar.gsp

    r59 r71  
    11<g:isLoggedIn>
    2     <g:ifAnyGranted role="ROLE_ADMIN">
     2    <g:ifAnyGranted role="ROLE_AppAdmin">
    33        <span class="appControlButton">
    44            <g:link controller="appCore" action="admin">
     
    88    </g:ifAnyGranted>
    99    <span class="appControlButton">
     10        <g:link controller="appCore" action="options">
     11                Options
     12        </g:link>
     13    </span>
     14    <span class="appControlButton">
    1015        <g:link controller="logout">
    1116                Log out
  • branches/TaskRewrite/src/grails-app/views/appCore/admin.gsp

    r59 r71  
    1616                <ul>
    1717                <g:each var="c" in="${grailsApplication.controllerClasses}">
    18                         <li class="controller"><g:link
    19     controller="${c.logicalPropertyName}">${c.fullName}</g:link></li>
     18                        <li class="controller"><g:link controller="${c.logicalPropertyName}">${c.fullName}</g:link></li>
    2019                </g:each>
    2120                </ul>
  • branches/TaskRewrite/src/grails-app/views/appCore/home.gsp

    r59 r71  
    1515                <div class="message">${flash.message}</div>
    1616            </g:if>
    17             <g:hasErrors bean="${person}">
     17            <g:hasErrors bean="${appCoreInstance}">
    1818                <div class="errors">
    19                     <g:renderErrors bean="${person}" as="list" />
     19                    <g:renderErrors bean="${appCoreInstance}" as="list" />
    2020                </div>
    2121            </g:hasErrors>
Note: See TracChangeset for help on using the changeset viewer.