Search

Hi, I'm using the Members extension. I have users that have access to files based on their role. 'High' users should be able to see everything, 'Medium' users should be able to see everything in their role and lower and finally 'Low' users should only be able to see files in their level.

I can see how to filter my 'Files' section directly matching the role but I can't see how to add the 'and lower' part.

Thanks, Josh

I believe if you filter members based on member role using the id of the role which is numeric then you will get the filtering in the datasource (if that's what you're asking about).

You should also have some sort of xslt in your templates that does something generically like this:

<xsl:choose>
    <xsl:when test="$member-role = 'High' or $member-role = 'Medium'>
        Templates to show ....    
    </xsl:when>    
    <xsl:otherwise>
        Templates for only 'low' clearance members    
    </xsl:otherwise>  
</xsl:choose>   

If I'm missing what you're asking, please post more details and we'll go from there.

Yes - I understand how to do that - what I was looking to do was filter it inside the Data Source so that I'm only pulling out the data I need and that I can use the paging. Thanks, Josh

I need to do a similar thing, and am not sure how to go about it.

To set which members can access a downloadable resource, I'm thinking I could use a tag field with tags that correspond to the names of the member roles. Is there a better way to do this that doesn't involve manually duplicating the role names?

Unfortunately there is no concept of 'and lower' in Member Roles. Roles are standalone instances and there is no ordering to say Role x is more permissive than Role y or vice versa.

My suggestion is to add a Select Box Link field that allows multiple selections to your Resources section and then tag each Resource with the Roles that are allowed to access it.

If you wanted to automate the selection of some roles you could look at adding some Javascript to the backend that will select Role x and y when Role z is selected etc.

Thanks @brendo. Unlike @moonty I'm not worried about 'and lower'.

My suggestion is to add a Select Box Link field that allows multiple selections to your Resources section and then tag each Resource with the Roles that are allowed to access it.

So I would create a 'Member roles' section with entries that duplicate the actual Member role names that are set up with the Members extension, and then control which members get to see it in the XSLT?

This wouldn't stop direct URL sharing, but I don't think that's a big issue for this project anyway. (Users could just share the downloaded files themselves anyway.) I've seen a couple of discussions that give pointers on how to go about protecting files and checking permissions before offering for download, but I'll think I'll keep this one as simple as possible.

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