Skip to content
Snippets Groups Projects
Commit bc4dd7af authored by buczekp's avatar buczekp
Browse files

[LMS-1625] improved authorization error message (order roles in message...

[LMS-1625] improved authorization error message (order roles in message starging from required role, then enumerate stronger roles) and fixed expectations of authorization tests

SVN: 16941
parent 8e5415ca
No related branches found
No related tags found
No related merge requests found
...@@ -139,8 +139,9 @@ public enum RoleWithHierarchy implements IsSerializable ...@@ -139,8 +139,9 @@ public enum RoleWithHierarchy implements IsSerializable
public Set<RoleWithHierarchy> getRoles() public Set<RoleWithHierarchy> getRoles()
{ {
Set<RoleWithHierarchy> roles = new LinkedHashSet<RoleWithHierarchy>(strongerRoles); Set<RoleWithHierarchy> roles = new LinkedHashSet<RoleWithHierarchy>();
roles.add(this); roles.add(this);
roles.addAll(strongerRoles);
return roles; return roles;
} }
......
...@@ -110,7 +110,7 @@ public class GenericSampleRegistrationTest extends AbstractGWTTestCase ...@@ -110,7 +110,7 @@ public class GenericSampleRegistrationTest extends AbstractGWTTestCase
FailureExpectation failureExpectation = FailureExpectation failureExpectation =
new FailureExpectation(GenericSampleRegistrationForm.RegisterSampleCallback.class) new FailureExpectation(GenericSampleRegistrationForm.RegisterSampleCallback.class)
.with("Authorization failure: None of method roles " .with("Authorization failure: None of method roles "
+ "'[INSTANCE_ADMIN, SPACE_ADMIN, SPACE_USER, SPACE_POWER_USER]' " + "'[SPACE_USER, SPACE_POWER_USER, SPACE_ADMIN, INSTANCE_ADMIN]' "
+ "could be found in roles of user 'observer'."); + "could be found in roles of user 'observer'.");
remoteConsole.prepare(failureExpectation); remoteConsole.prepare(failureExpectation);
launchTest(); launchTest();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment