Jump to content

Best Way To Implement More Complex Account Structure


dait

Recommended Posts

I am not familiar with Blesta code yet, I'm still in pre-sale phase, but I just need more information before I decide whether to go with Blesta or other solution.

 

I was looking for a bigger picture describing the design of user accounts in Blesta. I found this post:

 

http://www.blesta.com/forums/index.php?/topic/1041-users-clients-contacts-accounts/?p=8830

 

but that is not as detail as I would need. So I will ask my question directly ...

 

 

We are looking into having an account structure similar to what Google have with e.g. Analytics. They have users and they have accounts. An account is connected to a web site. Users are assigned rights to the accounts. So, one user can have access to multiple accounts and thus watch stats of multiple websites.

 

We want a similar thing in our project. We want accounts and users. A user would be either an end user or company - an entity that have its login credentials, address, can pay invoices. An account would be something that is related to our services. Each account has its administrator and then possibly other users that have access to its resources. The administrator manages which users are associated with his account. Administrator of the account can buy services for the account and these services can be consumed by its users.

 

Each user would have its own account and can be associated with accounts of other users and thus he can switch between the accounts - i.e. a user can switch to the company's account while he is in work and use its resources and then later at home he could switch to his personal account and use its resources ...

 

Now the question is how to implement this with Blesta.

 

1) We could implement our own system of accounts and users without Blesta and then pair our users with Blesta users. This should be definitely possible, but obviously this has disadventage of having two separate interfaces that our customer would have to switch between.

 

2) We could implement this to Blesta. Is this possible? Is it possible without chaning the core (i.e. only implement some kind of extension/module/plugin)?

 

What would be the best way to do that? Are there any existing extensions for more complex account structure already? Or can Blesta do that on its own without modifications?

 

Thanks a lot!

 

 

Link to comment
Share on other sites

We want a similar thing in our project. We want accounts and users. A user would be either an end user or company - an entity that have its login credentials, address, can pay invoices. An account would be something that is related to our services. Each account has its administrator and then possibly other users that have access to its resources. The administrator manages which users are associated with his account. Administrator of the account can buy services for the account and these services can be consumed by its users.

 

This is similar to contact login accounts, which is a feature slated for a future release of Blesta. The database already supports contacts having login (i.e. user) accounts, but the interface doesn't currently have the option to authenticate or restrict access based on permissions. However, the contact-based user authentication system would only permit a contact under a client account access to that client account. It is not planned to support a single contact access to multiple client accounts (though the database does support such a thing).

 

Now the question is how to implement this with Blesta.

 

1) We could implement our own system of accounts and users without Blesta and then pair our users with Blesta users. This should be definitely possible, but obviously this has disadventage of having two separate interfaces that our customer would have to switch between.

 

2) We could implement this to Blesta. Is this possible? Is it possible without chaning the core (i.e. only implement some kind of extension/module/plugin)?

 

What would be the best way to do that? Are there any existing extensions for more complex account structure already? Or can Blesta do that on its own without modifications?

 

Thanks a lot!

 

Depending on the access you want these users to have on client accounts, you could do this with a simple authentication plugin. You'd create a plugin with a login form that would authenticate against Blesta's users system, and initialize the appropriate session values to permit the user access to a client's account. If you wanted to allow the user to swtich between client accounts you'd need to create a page in your plugin to allow them to select a different client account to migrate to (by updating their session with the appropriate client ID).

 

If you only wanted to grant access to certain areas you'd have to implement an Appcontroller.preAction event handler and evaluate each URI to ensure the user can access it based upon your plugin's own custom permissions.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...