Changeset 289


Ignore:
Timestamp:
Jan 22, 2010, 12:27:04 PM (10 years ago)
Author:
gav
Message:

Set some permissions on Site and Section controllers.
Detail some site views missed in last commit.

Location:
trunk/grails-app
Files:
6 edited

Legend:

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

    r96 r289  
    33@Secured(['ROLE_AppAdmin'])
    44abstract class BaseAppAdminController {
    5     def whatsit() {
    6     }
    75
    86}
  • trunk/grails-app/controllers/BaseController.groovy

    r149 r289  
    33@Secured(['ROLE_AppUser', 'ROLE_AppAdmin'])
    44abstract class BaseController {
    5     def whatsit() {
    6     }
    75
    86}
  • trunk/grails-app/controllers/SectionDetailedController.groovy

    r288 r289  
    33@Secured(['ROLE_Manager','ROLE_AppAdmin'])
    44class SectionDetailedController extends BaseController {
    5    
    6     def index = { redirect(action:list,params:params) }
    75
    86    // the delete, save and update actions only accept POST requests
    97    static allowedMethods = [delete:'POST', save:'POST', update:'POST']
    108
     9    @Secured(['ROLE_AppAdmin','ROLE_Manager','ROLE_AppUser'])
     10    def index = { redirect(action:list,params:params) }
     11
     12    @Secured(['ROLE_AppAdmin','ROLE_Manager','ROLE_AppUser'])
    1113    def list = {
    1214        params.max = Math.min( params.max ? params.max.toInteger() : 10,  100)
     
    1416    }
    1517
     18    @Secured(['ROLE_AppAdmin','ROLE_Manager','ROLE_AppUser'])
    1619    def show = {
    1720        def sectionInstance = Section.get( params.id )
     
    2427    }
    2528
     29    @Secured(['ROLE_AppAdmin'])
    2630    def delete = {
    2731        def sectionInstance = Section.get( params.id )
  • trunk/grails-app/controllers/SiteDetailedController.groovy

    r288 r289  
    33@Secured(['ROLE_Manager','ROLE_AppAdmin'])
    44class SiteDetailedController extends BaseController {
    5    
    6     def index = { redirect(action:list,params:params) }
    75
    86    // the delete, save and update actions only accept POST requests
    97    static allowedMethods = [delete:'POST', save:'POST', update:'POST']
    108
     9    @Secured(['ROLE_AppAdmin','ROLE_Manager','ROLE_AppUser'])
     10    def index = { redirect(action:list,params:params) }
     11
     12    @Secured(['ROLE_AppAdmin','ROLE_Manager','ROLE_AppUser'])
    1113    def list = {
    1214        params.max = Math.min( params.max ? params.max.toInteger() : 10,  100)
     
    1416    }
    1517
     18    @Secured(['ROLE_AppAdmin','ROLE_Manager','ROLE_AppUser'])
    1619    def show = {
    1720        def siteInstance = Site.get( params.id )
     
    2427    }
    2528
     29    @Secured(['ROLE_AppAdmin'])
    2630    def delete = {
    2731        def siteInstance = Site.get( params.id )
  • trunk/grails-app/views/siteDetailed/edit.gsp

    r273 r289  
    6464<ul>
    6565<g:each var="i" in="${siteInstance?.inventoryStores?}">
    66     <li><g:link controller="inventoryStore" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>
     66    <li><g:link controller="inventoryStoreDetailed" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>
    6767</g:each>
    6868</ul>
    69 <g:link controller="inventoryStore" params="['site.id':siteInstance?.id]" action="create">Add InventoryStore</g:link>
     69<g:link controller="inventoryStoreDetailed" params="['site.id':siteInstance?.id]" action="create">Add InventoryStore</g:link>
    7070
    7171                                </td>
     
    8080<ul>
    8181<g:each var="s" in="${siteInstance?.sections?}">
    82     <li><g:link controller="section" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
     82    <li><g:link controller="sectionDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
    8383</g:each>
    8484</ul>
    85 <g:link controller="section" params="['site.id':siteInstance?.id]" action="create">Add Section</g:link>
     85<g:link controller="sectionDetailed" params="['site.id':siteInstance?.id]" action="create">Add Section</g:link>
    8686
    8787                                </td>
     
    9696<ul>
    9797<g:each var="s" in="${siteInstance?.siteExtendedAttributes?}">
    98     <li><g:link controller="siteExtendedAttribute" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
     98    <li><g:link controller="siteExtendedAttributeDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
    9999</g:each>
    100100</ul>
    101 <g:link controller="siteExtendedAttribute" params="['site.id':siteInstance?.id]" action="create">Add SiteExtendedAttribute</g:link>
     101<g:link controller="siteExtendedAttributeDetailed" params="['site.id':siteInstance?.id]" action="create">Add SiteExtendedAttribute</g:link>
    102102
    103103                                </td>
  • trunk/grails-app/views/siteDetailed/show.gsp

    r273 r289  
    5656                                <ul>
    5757                                <g:each var="i" in="${siteInstance.inventoryStores}">
    58                                     <li><g:link controller="inventoryStore" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>
     58                                    <li><g:link controller="inventoryStoreDetailed" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>
    5959                                </g:each>
    6060                                </ul>
     
    6969                                <ul>
    7070                                <g:each var="s" in="${siteInstance.sections}">
    71                                     <li><g:link controller="section" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
     71                                    <li><g:link controller="sectionDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
    7272                                </g:each>
    7373                                </ul>
     
    8282                                <ul>
    8383                                <g:each var="s" in="${siteInstance.siteExtendedAttributes}">
    84                                     <li><g:link controller="siteExtendedAttribute" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
     84                                    <li><g:link controller="siteExtendedAttributeDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
    8585                                </g:each>
    8686                                </ul>
Note: See TracChangeset for help on using the changeset viewer.