Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TRUNK-4049 Daemon cannot assing System Developer role
- Loading branch information
1 parent
67c9f03
commit e8dca61
Showing
2 changed files
with
6 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
import org.openmrs.api.db.DAOException; | ||
import org.openmrs.api.db.UserDAO; | ||
import org.openmrs.patient.impl.LuhnIdentifierValidator; | ||
import org.openmrs.util.OpenmrsConstants; | ||
import org.openmrs.util.OpenmrsUtil; | ||
import org.openmrs.util.PrivilegeConstants; | ||
import org.openmrs.util.RoleConstants; | ||
|
@@ -425,7 +426,8 @@ private void checkPrivileges(User user) { | |
List<String> requiredPrivs = new Vector<String>(); | ||
|
||
for (Role r : roles) { | ||
if (r.getRole().equals(RoleConstants.SUPERUSER) && !authUser.hasRole(RoleConstants.SUPERUSER)) | ||
if (r.getRole().equals(RoleConstants.SUPERUSER) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rkorytkowski
Author
Member
|
||
&& !Context.hasPrivilege(PrivilegeConstants.ASSIGN_SYSTEM_DEVELOPER_ROLE)) | ||
throw new APIException("You must have the role '" + RoleConstants.SUPERUSER + "' in order to assign it."); | ||
if (r.getPrivileges() != null) { | ||
for (Privilege p : r.getPrivileges()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Does this mean that even a super user will not be allowed if they do not have the PrivilegeConstants.ASSIGN_SYSTEM_DEVELOPER_ROLE ?