Blogs

  • Browse Blogs
  • My Blog
  • My Updates

Tags Help

  • View as cloud  | list

Similar Entries

photo

@GetFile & @GetFileC...

Blog:  .Domino Frame...
Peter Presnell
Updated 
No Ratings 0     No Comments 0
photo

DominoDocument.XML

Blog:  .Domino Frame...
Peter Presnell
Updated 
No Ratings 0     No Comments 0
photo

Extending a Java Cla...

Blog:  .Domino Frame...
Peter Presnell
Updated 
No Ratings 0     No Comments 0
photo

XSLT Transformation ...

Blog:  .Domino Frame...
Peter Presnell
Updated 
No Ratings 0     Comments 3
photo

New DominoDatabase.R...

Blog:  .Domino Frame...
Peter Presnell
Updated 
No Ratings 0     No Comments 0

Dogear Bookmarks

.Domino Framework

Blog Authors:  Peter Presnell  

Previous |  Main  | Next

DominoDatabase.HasRole Property

Peter Presnell  |     |  Tags:  .dominoframework roles  |  Comments (0)

One of the things I find I am often doing in creating business logic for an application is determining if the curtrent user has a specific role.  I have just added the following HasRoles property to the DominoDatabase class inside the .DOmino Framework as a way of quickly if a user has a specific role:-

'/** ' * Determine if specific user has a particular role for this database ' */ Property Get HasRole(pUserName As Variant,pRole As String) As Boolean Dim Username As String Dim UserRoles As Variant Try: On Error Goto Catch If(iDB Is Nothing) Then Exit Property Select Case Typename(pUsername) Case "STRING" If (pUserName = "") Then UserName$ = Session.UserName$ Else UserName$ = Cstr(pUserName) Case "NOTESITEM" UserName = Cstr(pUserName.Values(0)) Case Else UserName$ = Session.UserName$ End Select UserRoles = iDB.QueryAccessRoles(UserName$) Forall UserRole In UserRoles If Cstr(UserRole) = pRole Then HasRole = True Exit Property End If End Forall HasRole = False Exit Property Catch: Stop Call ReportError() Exit Property End Property

Comments

Previous |  Main  | Next
Skip to main content link. Accesskey S
IBM Lotus Connections Help Tools About

Tags

A tag is a keyword that is used to categorize an entry. To view the entries with a particular tag, click a tag name or enter a tag in the box.
The tag cloud indicates the frequency of tag use. Popular tags appear darkest. The slider control adjusts how many tags are displayed in the tag cloud.