Module MembershipService

Macros to manage and retrieve information about the members of a context.

Since: 2.1

Macro Summary
external

LSAF
%lsaf_addmember(lsaf_path=, lsaf_member=, lsaf_type=USER, lsaf_group_context=);
Adds a user or a group as a member of the specified context.
external

LSAF
%lsaf_getassignedmembers(lsaf_path=, sas_dsname=work.lsafGetAssignedMembers);
Gets the metadata for all of the members that are assigned to the specified context. The ...
external

LSAF
%lsaf_getpotentialmembers(lsaf_path=, sas_dsname=work.lsafGetPotentialMembers);
Gets the metadata for all of the users or groups that are available to be added as members ...
external

LSAF
%lsaf_ismember(lsaf_path=, lsaf_member=, lsaf_type=USER, lsaf_group_context=, lsaf_includeImplicit=0);
Indicates whether a user or group is a member in the specified context.
external

LSAF
%lsaf_removemember(lsaf_path=, lsaf_member=, lsaf_type=USER, lsaf_group_context=);
Removes a user or a group as a member of the specified context.

Macro Detail

%lsaf_addmember(lsaf_path=, lsaf_member=, lsaf_type=USER, lsaf_group_context=);

[ Exposure: external ]
Adds a user or a group as a member of the specified context.

Syntax:
%LSAF_ADDMEMBER(LSAF_PATH=lsaf-path, LSAF_MEMBER=lsaf-member-identifier,
<LSAF_TYPE=lsaf-member-type, LSAF_GROUP_CONTEXT=lsaf-group-context>);

Example Code
Context paths used in examples:
- Organization: /SAS
- Project: /SAS/Project1
- Analysis: /SAS/Project1/Analysis1

1. Add a user as a member at the project level:
%lsaf_addmember(LSAF_PATH=%str(/SAS/Project1), LSAF_MEMBER=%str(User1));

2. Add a group as a member at the project level:
%lsaf_addmember(lsaf_path=%str(/SAS/Project1), lsaf_member=%str(OrgGrp1),
lsaf_type=%str(GROUP), lsaf_group_context=%str(/SAS));

3. Add a user as a member at the analysis level:
%lsaf_addmember(LSAF_PATH=%str(/SAS/Project1/Analysis1), LSAF_MEMBER=%str(User1));

4. Add a group that is defined at an organization level as a member at the analysis level:
%lsaf_addmember(lsaf_path=%str(/SAS/Project1/Analysis1), lsaf_member=%str(OrgGrp1),
lsaf_type=%str(GROUP), lsaf_group_context=%str(/SAS));

          
History:
   2013-08-30
updates for standardization and coding conventions
   2016-08-29
rebrand as LSAF
   2019-01-15
updated for LSAF 5.1 functionality
Expected Macro Variables:
_lsafMsg_ - The return message.
_lsafRC_ - The return code.
Parameters:
lsaf_path - - Required - The path of the context to which to add the member.
lsaf_member - - Required - The user ID of the user or the name of the group.
lsaf_type - - Conditional - The type of member. Valid values (case-insensitive):
        - USER (Default)
        - GROUP
lsaf_group_context - - Conditional - The context in which the group is defined, specified
        as a path (such as /SAS). This parameter is required, if LSAF_TYPE=GROUP. Otherwise,
        it is ignored.
File: lsaf_addmember.sas
First available in version: 1.2

%lsaf_getassignedmembers(lsaf_path=, sas_dsname=work.lsafGetAssignedMembers);

[ Exposure: external ]
Gets the metadata for all of the members that are assigned to the specified context. The
metadata is stored in a SAS data set.

Syntax:
%LSAF_GETASSIGNEDMEMBERS(LSAF_PATH=lsaf-path <, SAS_DSNAME=SAS-data-set>);

          
History:
   2013-08-30
updates for standardization and coding conventions
   2016-08-26
rebrand as LSAF
   2019-11-01
update to handle a blank SAS output file.
Expected Macro Variables:
_lsafMsg_ - The return message.
_lsafRC_ - The return code.
Parameters:
lsaf_path - - Required - The path of the context that contains the members.
sas_dsname - - Optional - The name of the output SAS data set to contain the metadata
        for the members, specified as libref.dataset. The default value is
        WORK.LSAFGETASSIGNEDMEMBERS. The data set contains a row for each member and
        columns with the following names. The data set is sorted by the member type
        and principalId.
        - contextPath: The path of the context in which the members are assigned.
        - type: The member type. Valid values: USER and GROUP.
        - principalId: The name of the member. The returned values are either a group
        name or a user ID.
        - description: The description of the member. The returned values are either a
        group name or a user display name.
        - grpSrcCtxt: The context path in which the group member is defined, if the member
        is a group.
File: lsaf_getassignedmembers.sas
First available in version: 1.2

%lsaf_getpotentialmembers(lsaf_path=, sas_dsname=work.lsafGetPotentialMembers);

[ Exposure: external ]
Gets the metadata for all of the users or groups that are available to be added as members
to the specified context. The metadata is stored in a SAS data set.

Syntax:
%LSAF_GETPOTENTIALMEMBERS(LSAF_PATH=lsaf-path <, SAS_DSNAME=SAS-data-set>);

          
History:
   2020-02-10
initial coding
Expected Macro Variables:
_lsafMsg_ - The return message.
_lsafRC_ - The return code.
Parameters:
lsaf_path - - Required - The path of the context to determine potential members.
sas_dsname - - Optional - The name of the output SAS data set to contain the metadata
        for the potential members, specified as libref.dataset. The default value is
        WORK.LSAFGETPOTENTIALMEMBERS. The data set contains a row for each member and
        columns with the following names. The data set is sorted by the member type
        and principalId.
        - contextPath: The path of the context in which the members are assigned.
        - type: The member type. Valid values: USER and GROUP.
        - principalId: The name of the member, which is a user group name or a user ID.
        - description: The description of the member. The returned value is a user group
        name or a user display name.
        - grpSrcCtxt: The context path in which the group member is defined, if the member
        is a user group.
File: lsaf_getpotentialmembers.sas
First available in version: 2.3

%lsaf_ismember(lsaf_path=, lsaf_member=, lsaf_type=USER, lsaf_group_context=, lsaf_includeImplicit=0);

[ Exposure: external ]
Indicates whether a user or group is a member in the specified context.

The SAS macro variable _lsafIsMember_ is set to a value of 1 when the specified user or group
is a member of the context, 0 if it is not. In the event of an incorrect call to the macro
that results in an error, the return value of _lsafIsMember_ is set to -1. Groups
defined at the context level are not considered as members of that context.

Syntax:
%LSAF_ISMEMBER(LSAF_PATH=lsaf-path, LSAF_MEMBER=lsaf-member-identifier <, LSAF_TYPE=lsaf-type,
LSAF_GROUP_CONTEXT=lsaf-group-context>, LSAF_INCLUDEIMPLICIT=implicit-flag>);

          
History:
   2013-08-30
updates for standardization and coding conventions
   2016-08-26
rebrand as LSAF
   2019-02-11
update to 2.1
Expected Macro Variables:
_lsafIsMember_ - Indicates whether the user or group is a member of the specified context.
_lsafMsg_ - The return message.
_lsafRC_ - The return code.
Parameters:
lsaf_path - - Required - The absolute path of the context.
lsaf_member - - Required - The user ID or group name of the member.
lsaf_type - - Conditional - The type of member. Valid values (case-insensitive):
        - USER (Default)
        - GROUP
lsaf_group_context - - Conditional - The context in which the member group is defined,
        specified as a path (such as /SAS). The parameter is required, if LSAF_TYPE=GROUP.
        Otherwise, it is ignored.
lsaf_includeImplicit - - Optional - Indicates whether to report that the user is an
        implicit member of the context through group membership. The default value is 0,
        which reports whether the user is an explicit member of the context by user ID only.
        Valid values:
        - 0 (Default)
        - 1
File: lsaf_ismember.sas
First available in version: 1.2

%lsaf_removemember(lsaf_path=, lsaf_member=, lsaf_type=USER, lsaf_group_context=);

[ Exposure: external ]
Removes a user or a group as a member of the specified context.

Syntax:
%LSAF_REMOVEMEMBER(LSAF_PATH=lsaf-path, LSAF_MEMBER=lsaf-member-identifier
<, LSAF_TYPE=lsaf-type, LSAF_GROUP_CONTEXT=lsaf-group-context>);

          
History:
   2013-08-30
updates for standardization and coding conventions
   2016-08-29
rebrand as LSAF
   2019-01-15
updated for LSAF 5.1 functionality
Expected Macro Variables:
_lsafMsg_ - The return message.
_lsafRC_ - The return code.
Parameters:
lsaf_path - - Required - The path of the context from which to remove the member.
lsaf_member - - Required - The ID of the user or the name of the group.
lsaf_type - - Conditional - The type of the member. Valid values (case-insensitive):
        - USER (Default)
        - GROUP
lsaf_group_context - - Conditional - The context in which the group to remove is defined,
        specified as a path (such as /SAS). This parameter is required, if LSAF_TYPE=GROUP.
        Otherwise, it is ignored.
File: lsaf_removemember.sas
First available in version: 1.2