Search in sources :

Example 1 with UserRole

use of fi.otavanopisto.pyramus.framework.UserRole in project pyramus by otavanopisto.

the class AdminPasswordSetupWizardViewController method getAllowedRoles.

@Override
public UserRole[] getAllowedRoles() {
    StaffMemberDAO userDAO = DAOFactory.getInstance().getStaffMemberDAO();
    List<StaffMember> users = userDAO.listAll();
    if (users.isEmpty()) {
        return new UserRole[] { UserRole.EVERYONE };
    } else {
        return super.getAllowedRoles();
    }
}
Also used : StaffMemberDAO(fi.otavanopisto.pyramus.dao.users.StaffMemberDAO) UserRole(fi.otavanopisto.pyramus.framework.UserRole) StaffMember(fi.otavanopisto.pyramus.domainmodel.users.StaffMember)

Aggregations

StaffMemberDAO (fi.otavanopisto.pyramus.dao.users.StaffMemberDAO)1 StaffMember (fi.otavanopisto.pyramus.domainmodel.users.StaffMember)1 UserRole (fi.otavanopisto.pyramus.framework.UserRole)1