Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 413655 - [server] AuthorizationService.addUserRight() adds roles before the admin user is created
Summary: [server] AuthorizationService.addUserRight() adds roles before the admin user...
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Server (show other bugs)
Version: 4.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.0 M1   Edit
Assignee: Anthony Hunter CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 412995
  Show dependency tree
 
Reported: 2013-07-24 11:07 EDT by Anthony Hunter CLA
Modified: 2013-08-07 13:06 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Hunter CLA 2013-07-24 11:07:00 EDT
This is following from bug 335699#c6 :

"Since the user storage is not aware of user access rights, we need to edit Users.prefs manually and add rights to use '/users/*' URLs.
During M6, 'admin' account will have Admin role set and roles will be respected in our Authorization service."

I am creating a new implementation of an IMetaStore ( Bug 412995 ) , so "edit Users.prefs manually" will not work.

Two problems need to be solved:

1) the admin user has not been created in the IMetaStore.
This needs to be solved by creating the admin user using the MetaStore API.

2) The UserInfo does not have a documented API for roles.
This needs to be solved by adding the UserRights API to the UserInfo API and then creating the user rights with that API.
Comment 1 Anthony Hunter CLA 2013-07-31 11:22:14 EDT
Just to follow up on this:

(In reply to comment #0)
> Two problems need to be solved:
> 
> 1) the admin user has not been created in the IMetaStore.
> This needs to be solved by creating the admin user using the MetaStore API.

The SecureStorageCredentialsService.initStorage() creates the admin user in the secure storage but does not create an admin user in the IMetaStore. When AuthorizationService.addUserRight is run, it does a readUser() from the IMetaStore. As a result of the way CompatibilityMetaStore is implemented, readUser also creates the user.

The initStorage should call IMetaStore.createUser() to create the admin user in the MetaStore.
 
> 2) The UserInfo does not have a documented API for roles.
> This needs to be solved by adding the UserRights API to the UserInfo API and
> then creating the user rights with that API.

The "UserRights API" is implemented by the AuthorizationService and AuthorizationReader using the IMetaStore correctly using properties and it does not look like I need to change anything here.