Search

gentlemen,

i'm using members on a site with multiple business accounts. each business account has several logins (this is where members comes in), as well as several other sections with entries associated with that business's account.

now, i understand members' role permissions check for a select box link or any other relational field to attach that entry to the member in order to grant or deny them permission. however, based on my set up, entries are associated with business accounts and not member logins. where is a good place to start looking to change how this works?

would it be easier to grant "edit all" and write some custom logic into the events (there aren't many)?

would it be easier to grant "edit all" and write some custom logic into the events (there aren't many)?

I built something similar using a custom extension (which is not Open Source). If I get you right, you are talking about frontend publishing using Members and Symphony events, right?

My basic idea was that every entry in the system has an owner (business account, in your case), using an SBL field. During editing of entries (when the EventPreSaveFilter delegate is fired) the extension overrides owner values posted from the frontend, and it checks if the Member is an "admin" for this business account (this relation also uses an SBL field). Last, for existing entries, it checks if the Member is an admin for the business account which owns the current entry.

That is just the basic idea. In the end I needed a lot of code. The extension hooks into 8 different delegates, performs "page routes" (which you might not need), cares for custom 404 logic and dedicated page paremeters (like the current business account ID); and it has a "delete event" as well. All in all it is about 880 lines of (rather compact) code. It took me a long time to write this.

However, I am not sure if there is a simpler approach.

this is probably not the most maintainable way, but it's certainly saved the time. in my events, i'm hitting the database real fast to get the relation_id of the user to their company and comparing that to the relation_id of the entry being edited.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details