Share this page

# Example: Controlling User Permissions

This example demonstrates how you can prevent members of specific user groups from performing an action.

The code allows a user to replace a defect field value only if the user belongs to the `Admin` user group.

Add the code to the ActionCanExecute event procedure so that the check is performed when a user attempts to execute an action.

    Function ActionCanExecute(ActionName)
            ' Initialize the function's return value
    	' to avoid unpredictable behavior.
            ActionCanExecute = False
            On Error Resume Next
            If ActionName = "UserDefinedActions.BugReplaceAction1" _
                And Not User.IsInGroup("Admin") then
                ActionCanExecute = False
                msgbox "You do not have permission to perform this action"
            Else
                ActionCanExecute = True
            End If
            PrintError "ActionCanExecute"
            On Error GoTo 0
    End Function

https://admhelp.microfocus.com Application Quality Management 8942
Tips to improve your search results... OpenText™ Application Quality Management Help Center OpenText™ Application Quality Management Help Center OpenText™ Application Quality Management Help 26.1 All View Local Help Center View Online Help Center Version: