Manage Learn to apply best practices and optimize your operations.

Testing for Roles & Prevent pasting document in View!!

The tips is composed from a Public Fuction and a simple code to put in the QueryPaste view events.
In this code I testing for the "Admin" role. The Public Function can be used also for only testing User Roles.
Public Function UserHasRole(role As String) As Variant
	Dim vUserRoles As Variant
	
	UserHasRole = False
	vUserRoles = Evaluate("@UserRoles")
	Forall vRole In vUserRoles
		If vRole = role Then
			UserHasRole = True
			Exit Forall
		End If
	End Forall
	
End Function

Sub Querypaste(Source As Notesuiview, Continue As Variant)
	
	If UserHasRole("[Admin]") = True Then
		Continue = True
	Else
		Msgbox"Solo le utenze abilitate con il ruolo [Admin], possono incollare documenti"_
		, MB_ICONEXCLAMATION, "Attenzione !"
		
		Continue= UserHasRole("[Admin]")
	End If
	
End Sub

Dig Deeper on Domino Resources - Part 7

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close