Hide warning messages on bottom when user is not admin

FEA: ItEr75S04BugFixing
This commit is contained in:
Manuel Rego Casasnovas 2011-12-28 12:30:41 +01:00
parent bb31a38392
commit eb486c14c2
4 changed files with 15 additions and 1 deletions

View file

@ -56,4 +56,6 @@ public interface ITemplateModel {
String getIdUser(String login);
boolean isUserAdmin();
}

View file

@ -177,4 +177,9 @@ public class TemplateController extends GenericForwardComposer {
public String getIdWswriterUser() {
return templateModel.getIdUser(MandatoryUser.WSWRITER.getLoginName());
}
public boolean isUserAdmin() {
return templateModel.isUserAdmin();
}
}

View file

@ -51,6 +51,7 @@ import org.libreplan.business.scenarios.entities.OrderVersion;
import org.libreplan.business.scenarios.entities.Scenario;
import org.libreplan.business.users.daos.IUserDAO;
import org.libreplan.business.users.entities.User;
import org.libreplan.web.UserUtil;
import org.libreplan.web.security.SecurityUtils;
import org.libreplan.web.users.bootstrap.MandatoryUser;
import org.libreplan.web.users.services.CustomUser;
@ -477,4 +478,10 @@ public class TemplateModel implements ITemplateModel {
return null;
}
}
@Override
@Transactional(readOnly = true)
public boolean isUserAdmin() {
return UserUtil.getUserFromSession().isAdministrator();
}
}

View file

@ -126,7 +126,7 @@ signature="java.lang.Boolean isDefaultPasswordsControl()"?>
</borderlayout>
</center>
<south border="none">
<south border="none" if="${templateCtrl.userAdmin}">
<n:table width="100%">
<n:tr class="footer">
<n:td valign="center">