- Timestamp:
- Mar 25, 2009, 4:26:43 AM (16 years ago)
- Location:
- trunk/src/grails-app
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/grails-app/conf/BootStrap.groovy
r84 r91 67 67 BootStrapSaveAndTest(authInstance) 68 68 69 authInstance = new Authority(description:"Application User, all application users need this base role.", 69 authInstance = new Authority(description:"Business manager, grants full management access.", 70 authority:"ROLE_Manager") 71 BootStrapSaveAndTest(authInstance) 72 73 authInstance = new Authority(description:"Application User, all application users need this base role to allow login.", 70 74 authority:"ROLE_AppUser") 71 75 BootStrapSaveAndTest(authInstance) … … 85 89 personInstance.addToAuthorities(Authority.get(1)) 86 90 personInstance.addToAuthorities(Authority.get(2)) 91 personInstance.addToAuthorities(Authority.get(3)) 87 92 personInstance.addToPersonGroups(PersonGroup.findByName("gnuMims")) 88 93 89 personInstance = new Person(loginName:"admin2", 90 firstName:"Admin2", 91 lastName:"Powers2", 92 pass:passClearText, 93 password:passwordEncoded, 94 email:"admin2@example.com") 95 BootStrapSaveAndTest(personInstance) 96 personInstance.addToAuthorities(Authority.get(1)) 94 personInstance = new Person(loginName:"manager", 95 firstName:"Meca", 96 lastName:"Manager", 97 pass:passClearText, 98 password:passwordEncoded, 99 email:"manager@example.com") 100 BootStrapSaveAndTest(personInstance) 97 101 personInstance.addToAuthorities(Authority.get(2)) 102 personInstance.addToAuthorities(Authority.get(3)) 98 103 personInstance.addToPersonGroups(PersonGroup.findByName("gnuMims")) 99 104 … … 105 110 email:"user@example.com") 106 111 BootStrapSaveAndTest(personInstance) 107 personInstance.addToAuthorities(Authority.get( 2))112 personInstance.addToAuthorities(Authority.get(3)) 108 113 personInstance.addToPersonGroups(PersonGroup.findByName("Electrical")) 109 114 … … 115 120 email:"user@example.com") 116 121 BootStrapSaveAndTest(personInstance) 117 personInstance.addToAuthorities(Authority.get( 2))122 personInstance.addToAuthorities(Authority.get(3)) 118 123 personInstance.addToPersonGroups(PersonGroup.findByName("Electrical")) 119 124 … … 125 130 email:"user@example.com") 126 131 BootStrapSaveAndTest(personInstance) 127 personInstance.addToAuthorities(Authority.get( 2))132 personInstance.addToAuthorities(Authority.get(3)) 128 133 personInstance.addToPersonGroups(PersonGroup.findByName("Mechanical")) 129 134 … … 135 140 email:"user@example.com") 136 141 BootStrapSaveAndTest(personInstance) 137 personInstance.addToAuthorities(Authority.get( 2))142 personInstance.addToAuthorities(Authority.get(3)) 138 143 personInstance.addToPersonGroups(PersonGroup.findByName("Production")) 139 144 -
trunk/src/grails-app/controllers/AppCoreController.groovy
r73 r91 42 42 } 43 43 44 @Secured(['ROLE_Manager']) 45 def manager = { 46 } 44 47 45 48 @Secured(['ROLE_AppAdmin']) -
trunk/src/grails-app/controllers/PersonController.groovy
r73 r91 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 2 3 @Secured(['ROLE_AppAdmin' ])3 @Secured(['ROLE_AppAdmin', 'ROLE_Manager']) 4 4 class PersonController { 5 5 … … 53 53 //first, delete this person from Persons_Authorities table. 54 54 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 57 65 } 58 66 } -
trunk/src/grails-app/domain/Task.groovy
r69 r91 23 23 static constraints = { 24 24 targetStartDate() 25 description(blank:false,maxSize: 50)25 description(blank:false,maxSize:75) 26 26 leadPerson() 27 27 taskPriority() -
trunk/src/grails-app/views/_adminmenubar.gsp
r73 r91 1 1 <g:isLoggedIn> 2 <g:ifAnyGranted role="ROLE_Manager"> 3 <span class="appControlButton"> 4 <g:link controller="appCore" action="manager"> 5 Manager 6 </g:link> 7 </span> 8 </g:ifAnyGranted> 2 9 <g:ifAnyGranted role="ROLE_AppAdmin"> 3 10 <span class="appControlButton"> -
trunk/src/grails-app/views/appCore/admin.gsp
r84 r91 8 8 <div class="nav"> 9 9 <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span> 10 <span class="menuButton"><g:link controller="person" action="create">New Person</g:link></span>11 10 </div> 12 11 <div class="body"> 13 <h1> Welcome toAdmin</h1>12 <h1>Application Admin</h1> 14 13 <div class="errors"> 15 "Warning these pages are for use by the application admin only and not for daily use." <br /> 16 "They allow direct administration of the back-end data, cascade deletion and updates may occur." 14 Warning!<br /> 15 The pages bellow this line are for use by the application admin only and NOT for daily use.<br /> 16 They allow direct administration of the back-end data, cascade deletion and updates may occur.<br /> 17 The manager authorisation and pages should be used for normal daily use.<br /> 17 18 </div> 18 19 <br/> -
trunk/src/grails-app/views/taskDetailed/create.gsp
r85 r91 32 32 </td> 33 33 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'description','errors')}"> 34 <input type="text" style="width:450px" maxlength=" 50" id="description" name="description" value="${fieldValue(bean:taskInstance,field:'description')}"/>34 <input type="text" style="width:450px" maxlength="75" id="description" name="description" value="${fieldValue(bean:taskInstance,field:'description')}"/> 35 35 </td> 36 36 </tr> -
trunk/src/grails-app/views/taskDetailed/edit.gsp
r86 r91 41 41 </td> 42 42 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'description','errors')}"> 43 <input type="text" style="width:450px" maxlength=" 50" id="description" name="description" value="${fieldValue(bean:taskInstance,field:'description')}"/>43 <input type="text" style="width:450px" maxlength="75" id="description" name="description" value="${fieldValue(bean:taskInstance,field:'description')}"/> 44 44 </td> 45 45 </tr> … … 98 98 </td> 99 99 </tr> 100 101 <tr class="prop">102 <td valign="top" class="name">103 <label for="assignedPersons">Assigned Persons:</label>104 </td>105 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'assignedPersons','errors')}">106 107 <ul>108 <g:each var="a" in="${taskInstance?.assignedPersons?}">109 <li><g:link controller="person" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>110 </g:each>111 </ul>112 <g:link controller="person" params="['task.id':taskInstance?.id]" action="create">Add Person</g:link>113 114 </td>115 </tr>116 100 117 101 <tr class="prop"> -
trunk/src/grails-app/views/taskDetailed/show.gsp
r86 r91 59 59 <td valign="top" class="name">Lead Person:</td> 60 60 61 <td valign="top" class="value"> <g:link controller="person" action="show" id="${taskInstance?.leadPerson?.id}">${taskInstance?.leadPerson?.encodeAsHTML()}</g:link></td>61 <td valign="top" class="value">${taskInstance?.leadPerson?.encodeAsHTML()}</td> 62 62 63 63 </tr> … … 66 66 <td valign="top" class="name">Task Priority:</td> 67 67 68 <td valign="top" class="value"> <g:link controller="taskPriority" action="show" id="${taskInstance?.taskPriority?.id}">${taskInstance?.taskPriority?.encodeAsHTML()}</g:link></td>68 <td valign="top" class="value">${taskInstance?.taskPriority?.encodeAsHTML()}</td> 69 69 70 70 </tr> … … 73 73 <td valign="top" class="name">Task Status:</td> 74 74 75 <td valign="top" class="value"> <g:link controller="taskStatus" action="show" id="${taskInstance?.taskStatus?.id}">${taskInstance?.taskStatus?.encodeAsHTML()}</g:link></td>75 <td valign="top" class="value">${taskInstance?.taskStatus?.encodeAsHTML()}</td> 76 76 77 77 </tr> … … 79 79 <tr class="prop"> 80 80 <td valign="top" class="name">Assigned Persons:</td> 81 82 <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'assignedPersons')}</td>83 84 </tr>85 86 <tr class="prop">87 <td valign="top" class="name">Is Active:</td>88 89 <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'isActive')}</td>90 91 </tr>92 93 <tr class="prop">94 <td valign="top" class="name">Is Approved:</td>95 96 <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'isApproved')}</td>97 98 </tr>99 100 <tr class="prop">101 <td valign="top" class="name">Is Scheduled:</td>102 103 <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'isScheduled')}</td>104 105 </tr>106 107 <tr class="prop">108 <td valign="top" class="name">Modifications:</td>109 81 110 82 <td valign="top" style="text-align:left;" class="value"> 111 83 <ul> 112 <g:each var=" m" in="${taskInstance.modifications}">113 <li> <g:link controller="modification" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li>84 <g:each var="s" in="${taskInstance.assignedPersons}"> 85 <li>${s?.firstName} ${s?.lastName}</li> 114 86 </g:each> 115 87 </ul> 116 88 </td> 89 90 </tr> 91 92 <tr class="prop"> 93 <td valign="top" class="name">Is Active:</td> 94 95 <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'isActive')}</td> 96 97 </tr> 98 99 <tr class="prop"> 100 <td valign="top" class="name">Is Approved:</td> 101 102 <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'isApproved')}</td> 103 104 </tr> 105 106 <tr class="prop"> 107 <td valign="top" class="name">Is Scheduled:</td> 108 109 <td valign="top" class="value">${fieldValue(bean:taskInstance, field:'isScheduled')}</td> 117 110 118 111 </tr> … … 141 134 <td valign="top" class="name">Task Group:</td> 142 135 143 <td valign="top" class="value"> <g:link controller="taskGroup" action="show" id="${taskInstance?.taskGroup?.id}">${taskInstance?.taskGroup?.encodeAsHTML()}</g:link></td>136 <td valign="top" class="value">${taskInstance?.taskGroup?.encodeAsHTML()}</td> 144 137 145 138 </tr> … … 148 141 <td valign="top" class="name">Task Type:</td> 149 142 150 <td valign="top" class="value"> <g:link controller="taskType" action="show" id="${taskInstance?.taskType?.id}">${taskInstance?.taskType?.encodeAsHTML()}</g:link></td>143 <td valign="top" class="value">${taskInstance?.taskType?.encodeAsHTML()}</td> 151 144 152 145 </tr> … … 168 161 <thead> 169 162 <tr> 170 <g:sortableColumn property="comment" title="Comment" /> 163 <th style="color:Black">Comment</th> 164 <th style="color:Black">Date Done</th> 165 <th style="color:Black">Entered By</th> 166 <!-- <g:sortableColumn property="comment" title="Comment" /> 171 167 172 168 <g:sortableColumn property="dateDone" title="Date Done" /> 173 169 174 <g:sortableColumn property="enteredBy" title="Entered By" /> 170 <g:sortableColumn property="enteredBy" title="Entered By" />--> 175 171 </tr> 176 172 </thead> … … 198 194 <thead> 199 195 <tr> 200 <g:sortableColumn property="comment" title="Comment" /> 201 202 <g:sortableColumn property="dateDone" title="Date Done" /> 203 204 <g:sortableColumn property="enteredBy" title="Entered By" /> 196 <th style="color:Black">Comment</th> 197 <th style="color:Black">Date Done</th> 198 <th style="color:Black">Entered By</th> 199 <!-- <g:sortableColumn property="commentW" title="Comment" /> 200 201 <g:sortableColumn property="dateDoneW" title="Date Done" /> 202 203 <g:sortableColumn property="enteredByW" title="Entered By" />--> 205 204 </tr> 206 205 </thead> … … 223 222 </div> 224 223 224 <br /> 225 226 <div class="buttons"> 227 <span class="menuButton" style="height:50px"> 228 <g:link controller="entryDetailed" params="['task.id':taskInstance.id]" action="create">Add Entry</g:link> 229 </span> 230 </div> 231 225 232 </div> 226 233 </body>
Note: See TracChangeset
for help on using the changeset viewer.