Class ScopePermission
- Namespace
- Steeltoe.Security.Authentication.CloudFoundry.Wcf
- Assembly
- Steeltoe.Security.Authentication.CloudFoundryWcf.dll
[Serializable]
public sealed class ScopePermission : IPermission, ISecurityEncodable, IUnrestrictedPermission
- Inheritance
-
ScopePermission
- Implements
- Inherited Members
Constructors
ScopePermission(string, string)
public ScopePermission(string name, string scope)
Parameters
Properties
Scope
public string Scope { get; set; }
Property Value
Methods
Copy()
Creates and returns an identical copy of the current permission.
public IPermission Copy()
Returns
- IPermission
A copy of the current permission.
Demand()
Throws a SecurityException at run time if the security requirement is not met.
public void Demand()
FromXml(SecurityElement)
Reconstructs a security object with a specified state from an XML encoding.
public void FromXml(SecurityElement e)
Parameters
e
SecurityElementThe XML encoding to use to reconstruct the security object.
Intersect(IPermission)
Creates and returns a permission that is the intersection of the current permission and the specified permission.
public IPermission Intersect(IPermission target)
Parameters
target
IPermissionA permission to intersect with the current permission. It must be of the same type as the current permission.
Returns
- IPermission
A new permission that represents the intersection of the current permission and the specified permission. This new permission is null if the intersection is empty.
Exceptions
- ArgumentException
The
target
parameter is not null and is not an instance of the same class as the current permission.
IsSubsetOf(IPermission)
Determines whether the current permission is a subset of the specified permission.
public bool IsSubsetOf(IPermission target)
Parameters
target
IPermissionA permission that is to be tested for the subset relationship. This permission must be of the same type as the current permission.
Returns
- bool
true if the current permission is a subset of the specified permission; otherwise, false.
Exceptions
- ArgumentException
The
target
parameter is not null and is not of the same type as the current permission.
IsUnrestricted()
Returns a value indicating whether unrestricted access to the resource protected by the permission is allowed.
public bool IsUnrestricted()
Returns
- bool
true if unrestricted use of the resource protected by the permission is allowed; otherwise, false.
ToXml()
Creates an XML encoding of the security object and its current state.
public SecurityElement ToXml()
Returns
- SecurityElement
An XML encoding of the security object, including any state information.
Union(IPermission)
Creates a permission that is the union of the current permission and the specified permission.
public IPermission Union(IPermission target)
Parameters
target
IPermissionA permission to combine with the current permission. It must be of the same type as the current permission.
Returns
- IPermission
A new permission that represents the union of the current permission and the specified permission.
Exceptions
- ArgumentException
The
target
parameter is not null and is not of the same type as the current permission.