Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Declarative Security w/ custom principal

Declarative Security w/ custom principal

Scheduled Pinned Locked Moved Visual Basic
securityhelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Moonark
    wrote on last edited by
    #1

    I have created a custom principal class based on IPrincipal and have exteded it for additional properties and methogs such as .UserName, .UserID to return data and IsInAnyRole to accept a list of possible roles for a user. Is there a way that I can use Declarative security with this for something like... Public Shared Sub _ [PrincipalPermissionAttribute(SecurityAction.Demand, IsInAnyRole:="Role1,Role2,etc...")] _ PrivateInfo() 'Print secret data. Console.WriteLine(ControlChars.CrLf + "You have access to the private data!") End Sub The isInAnyRole is not part of the PrincipalPermissionAttribute class though. Is there an easy way to write or extend it so that I can use it with extended methods from my custom principal class? Thanks in advanvce for any help...

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups