Member Groups

Use our Forums to find examples and answers to your questions. If you have advanced requirements for your project, contact us and our staff can help you find a solution.

hccdevelopment

Member Groups

The Member Groups tag allows you to control access to resources by member groups.

{exp:resources:member_groups permission="group" action="view" limit="1" pagination="both"

Parameters

member_id="1" 

The member_id of the user for whom to get the resource group. The default value is the logged in member's ID.

permission="Private|group" 

Filter group results to only show certain permission levels:

  • all: Get all the members Resource Groups
  • public: Get all the publicly available Resource Groups
  • group: Get all the Resource Groups that are only allowed on the Group level
  • private: Get only the Resource Groups the member owns
resource_group_id="2|3" 

Get the resource groups by their ID. This overrides the permission tag parameter.

action="view" 

This is what the member is trying to do with the Resource Group. Possible values are "view" or "change"

Tag Conditionals
  • resource_groups: TRUE if there are resources groups and FALSE if there aren't any Resource Groups in the result
  • no_resource_groups: TRUE if there are no resource groups and FALSE if there are Resource Groups in the result
  • group_total_count: The number of Resource Groups
Variables
  • group_total_count
Variable Pairs
  • resource_groups
  • resource_group_group_id
  • resource_group_name
  • resource_group_member_id
  • resource_group_name
  • resource_group_creation_date
Conditionals
  • resource_group_member_allowed_in_group

Example

{exp:resources:member_groups permission="group" action="view" limit="1" pagination="both"}
    {if resource_groups}
    {resource_groups}
        {if resource_group_member_allowed_in_group}
        {resource_group_name}
        {if
:else}
        Not Allowed
.
        
{/if}
    {
/resource_groups}
        {paginate}
            {pagination_links}
        {
/paginate}
    {
/if}
{
/exp:resources:member_groups} 

Using conditionals is an important component to restricting access to your resources.



Join our Mailing List