This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit 6bf81571ac6d97cd7abdd5161eec6fcceb9ba17f Author: Brendan Le Ny <bleny@codelutin.com> Date: Mon Dec 15 10:45:50 2014 +0100 Ouverture de l'accès au programme Scléro pour le compte 'admin', correction du formulaire d'administration des utilisateurs pour ne pas pouvoir utiliser la notion d'invité et de professionnel --- .../db/migration/V5_0__sclerochronology.sql | 13 ++++++ wao-persistence/src/main/xmi/wao-model.properties | 2 +- .../administration/UpdateWaoUserCommand.java | 9 ++++ .../content/administration/edit-wao-user.jsp | 4 +- .../src/main/webapp/WEB-INF/decorators/layout.jsp | 50 ++++++++++++---------- 5 files changed, 52 insertions(+), 26 deletions(-) diff --git a/wao-persistence/src/main/resources/db/migration/V5_0__sclerochronology.sql b/wao-persistence/src/main/resources/db/migration/V5_0__sclerochronology.sql new file mode 100644 index 0000000..ee61e50 --- /dev/null +++ b/wao-persistence/src/main/resources/db/migration/V5_0__sclerochronology.sql @@ -0,0 +1,13 @@ + + +-- Ouverture de l'accès au programme sclérochronologie du compte admin +insert into UserProfile values ( + 'fr.ifremer.wao.entities.UserProfile#129111142543000#933200987654321550', + 1, + now(), + (select topiaId from WaoUser where login = 'admin'), + 'SCLEROCHRONOLOGY', + 'ADMIN', + true, + uuid_in(md5(random()::text || now()::text)::cstring) +); diff --git a/wao-persistence/src/main/xmi/wao-model.properties b/wao-persistence/src/main/xmi/wao-model.properties index 86db9ad..b807930 100644 --- a/wao-persistence/src/main/xmi/wao-model.properties +++ b/wao-persistence/src/main/xmi/wao-model.properties @@ -21,7 +21,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # #L% ### -model.tagValue.version=4.3 +model.tagValue.version=5.0 model.tagValue.useEnumerationName=true # orderBy tagValues diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/UpdateWaoUserCommand.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/UpdateWaoUserCommand.java index d40c5dd..ef67ec0 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/UpdateWaoUserCommand.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/UpdateWaoUserCommand.java @@ -257,4 +257,13 @@ public class UpdateWaoUserCommand implements Serializable{ public void setObsProgram(ObsProgram obsProgram) { this.obsProgram = obsProgram; } + + public boolean isGuestRoleAvailable() { + return ! obsProgram.isSclerochronology(); + } + + public boolean isProfessionalRoleAvailable() { + return ! obsProgram.isSclerochronology(); + } + } diff --git a/wao-web/src/main/webapp/WEB-INF/content/administration/edit-wao-user.jsp b/wao-web/src/main/webapp/WEB-INF/content/administration/edit-wao-user.jsp index 66e6cac..9466a5f 100644 --- a/wao-web/src/main/webapp/WEB-INF/content/administration/edit-wao-user.jsp +++ b/wao-web/src/main/webapp/WEB-INF/content/administration/edit-wao-user.jsp @@ -149,11 +149,11 @@ <s:checkbox name="updateWaoUserCommand.observer" label="%{getText('wao.ui.form.updateWaoUserCommand.observer')}" /> <s:checkbox name="updateWaoUserCommand.observerReadOnly" label="%{getText('wao.ui.form.updateWaoUserCommand.observerReadOnly')}" /> </s:if> - <s:if test="authenticatedWaoUser.authorizedToSetGuest"> + <s:if test="authenticatedWaoUser.authorizedToSetGuest && updateWaoUserCommand.guestRoleAvailable"> <s:checkbox name="updateWaoUserCommand.guest" label="%{getText('wao.ui.form.updateWaoUserCommand.guest')}" /> <s:checkbox name="updateWaoUserCommand.guestReadOnly" label="%{getText('wao.ui.form.updateWaoUserCommand.guestReadOnly')}" /> </s:if> - <s:if test="authenticatedWaoUser.authorizedToSetProfessional"> + <s:if test="authenticatedWaoUser.authorizedToSetProfessional && updateWaoUserCommand.professionalRoleAvailable"> <s:checkbox name="updateWaoUserCommand.professional" label="%{getText('wao.ui.form.updateWaoUserCommand.professional')}" /> <s:checkbox name="updateWaoUserCommand.professionalReadOnly" label="%{getText('wao.ui.form.updateWaoUserCommand.professionalReadOnly')}" /> <div id="defineCanReadBoats"> diff --git a/wao-web/src/main/webapp/WEB-INF/decorators/layout.jsp b/wao-web/src/main/webapp/WEB-INF/decorators/layout.jsp index 3f9cf39..7f9a39f 100644 --- a/wao-web/src/main/webapp/WEB-INF/decorators/layout.jsp +++ b/wao-web/src/main/webapp/WEB-INF/decorators/layout.jsp @@ -115,8 +115,6 @@ <div class="navbar"> <div class="navbar-inner"> <a class="brand" href="#"><span>WAO</span> <s:text name="%{obsProgram.getI18nKey()}"/></a> - - <%--<a class="brand" href="#">Wao <s:property value="%{getText(#obsProgram.getI18nKey())}" /></a>--%> <ul class="nav"> <li class="<decorator:getProperty property="page.newsMenuItemClass"/>"> <s:url namespace="/%{obsProgram.name().toLowerCase()}" action="news" id="newsUrl" /> @@ -130,29 +128,35 @@ <i class="fa fa-calendar"></i> <s:text name="wao.ui.page.SamplingPlan.title" /> </s:a> </li> - <s:if test="authenticatedWaoUser.authorizedToViewBoats"> - <li class="<decorator:getProperty property="page.boatsMenuItemClass"/>"> - <s:url namespace="/%{obsProgram.name().toLowerCase()}" action="boats" id="boatsUrl" /> - <s:a href="%{boatsUrl}"> - <i class="fa fa-anchor"></i> <s:text name="wao.ui.page.Boats.title" /> - </s:a> - </li> + <s:if test=" ! sclerochronology"> + <s:if test="authenticatedWaoUser.authorizedToViewBoats"> + <li class="<decorator:getProperty property="page.boatsMenuItemClass"/>"> + <s:url namespace="/%{obsProgram.name().toLowerCase()}" action="boats" id="boatsUrl" /> + <s:a href="%{boatsUrl}"> + <i class="fa fa-anchor"></i> <s:text name="wao.ui.page.Boats.title" /> + </s:a> + </li> + </s:if> </s:if> - <s:if test="authenticatedWaoUser.authorizedToViewContacts"> - <li class="<decorator:getProperty property="page.contactsMenuItemClass"/>"> - <s:url namespace="/%{obsProgram.name().toLowerCase()}" action="contacts" id="contactsUrl" /> - <s:a href="%{contactsUrl}"> - <i class="fa fa-stack-exchange"></i> <s:text name="wao.ui.page.Contacts.title" /> - </s:a> - </li> + <s:if test=" ! sclerochronology"> + <s:if test="authenticatedWaoUser.authorizedToViewContacts"> + <li class="<decorator:getProperty property="page.contactsMenuItemClass"/>"> + <s:url namespace="/%{obsProgram.name().toLowerCase()}" action="contacts" id="contactsUrl" /> + <s:a href="%{contactsUrl}"> + <i class="fa fa-stack-exchange"></i> <s:text name="wao.ui.page.Contacts.title" /> + </s:a> + </li> + </s:if> </s:if> - <s:if test="authenticatedWaoUser.authorizedToViewSynthesis"> - <li class="<decorator:getProperty property="page.synthesisMenuItemClass"/>"> - <s:url namespace="/%{obsProgram.name().toLowerCase()}" action="synthesis" id="synthesisUrl" /> - <s:a href="%{synthesisUrl}"> - <i class="fa fa-bar-chart-o"></i> <s:text name="wao.ui.page.Synthesis.title" /> - </s:a> - </li> + <s:if test=" ! sclerochronology"> + <s:if test="authenticatedWaoUser.authorizedToViewSynthesis"> + <li class="<decorator:getProperty property="page.synthesisMenuItemClass"/>"> + <s:url namespace="/%{obsProgram.name().toLowerCase()}" action="synthesis" id="synthesisUrl" /> + <s:a href="%{synthesisUrl}"> + <i class="fa fa-bar-chart-o"></i> <s:text name="wao.ui.page.Synthesis.title" /> + </s:a> + </li> + </s:if> </s:if> </ul> <ul class="nav pull-right"> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.