Table of Contents

Class Permission

Namespace
Dynamicweb.Content.Files
Assembly
Dynamicweb.dll
Represents a folder permission.
[Obsolete("Do not use")]
public class Permission : DbObject
Inheritance
Permission
Inherited Members

Constructors

Permission()

Creates a new instance of the class.
public Permission()

Fields

AdminUserType

public const int AdminUserType = 3

Field Value

int

Properties

AccessElementPermissionElementID

Gets or sets the element ID.
public int AccessElementPermissionElementID { get; set; }

Property Value

int
The element ID.

AccessElementPermissionElementTextID

Gets or sets the element text ID.
public string AccessElementPermissionElementTextID { get; set; }

Property Value

string
The element text ID.

AccessElementPermissionReadTypePermission

Gets or sets the access element permission read type permission.
public Permission.FolderPermissionAccess AccessElementPermissionReadTypePermission { get; set; }

Property Value

Permission.FolderPermissionAccess
The access element permission read type permission.

AccessElementPermissionTypeID

Gets or sets the type ID.
public int AccessElementPermissionTypeID { get; set; }

Property Value

int
The type ID.

AccessElementPermissionTypePermission

Gets or sets the type permission.
[Obsolete("Use AccessElementPermissionReadTypePermission property instead.")]
public Permission.FolderPermissionAccess AccessElementPermissionTypePermission { get; set; }

Property Value

Permission.FolderPermissionAccess
The type permission.

AccessElementPermissionUserID

Gets or sets the user ID.
public int AccessElementPermissionUserID { get; set; }

Property Value

int
The user ID.

AccessElementPermissionWriteTypePermission

Gets or sets the access element permission write type permission.
public Permission.FolderPermissionAccess AccessElementPermissionWriteTypePermission { get; set; }

Property Value

Permission.FolderPermissionAccess
The access element permission write type permission.

ID

Gets or sets permission's ID.
public int ID { get; set; }

Property Value

int
Permission's ID.

IsAdministrator

Gets a value indicating if the current user is administrator.
public static bool IsAdministrator { get; }

Property Value

bool
true if the current user is administrator; otherwise false.

IsAngelOrSysAdmin

Gets a value indicating if the current user is angel or system administrator.
public static bool IsAngelOrSysAdmin { get; }

Property Value

bool
true if the current user is angel or system administrator; otherwise false.

ToDelete

Gets or sets a value indicating whether a permission should be delete or not.
public bool ToDelete { get; set; }

Property Value

bool
true if to delete; otherwise false.

Methods

ClearCache()

Clears the cache for the permissions.
public static void ClearCache()

CopyPermissions(DirectoryInfo, DirectoryInfo, string, bool)

Copy the permissions of the current folder and its subfolders.
public static void CopyPermissions(DirectoryInfo source, DirectoryInfo target, string root, bool withPermissions)

Parameters

source DirectoryInfo
target DirectoryInfo
root string
withPermissions bool

Delete()

Deletes a permission from the database.
public void Delete()

DeletePermissions(DirectoryInfo, string, bool)

Deletes the permissions of the current folder and its subfolders.
public static void DeletePermissions(DirectoryInfo source, string root, bool withPermissions)

Parameters

source DirectoryInfo
root string
withPermissions bool

Fill(IDataReader)

Fills object properties according to provided IDataReader.
public override void Fill(IDataReader reader)

Parameters

reader IDataReader
Data holder.

FillRow(DataRow)

Override the FillRow method to map all the properties values to their respective field on the datarow. Used when the object is being saved.
protected override void FillRow(DataRow row)

Parameters

row DataRow
The datarow to fill with data.

GetAccessElements(string)

Returns restricted elements (ex. folders).
public static string GetAccessElements(string type)

Parameters

type string

Returns

string
Returns a comma separated string.

GetParentFolderPath(string)

Gets the parent folder path.
public static string GetParentFolderPath(string folderPath)

Parameters

folderPath string
The folder path.

Returns

string
System.String.

GetPermission(string, string, string)

Gets the permission.
public static Permission GetPermission(string userID, string elType, string elName)

Parameters

userID string
The user identifier.
elType string
Type access
elName string
Name of the element

Returns

Permission
Permission.

GetPermissionByID(string, string)

Retrieves a permission by user ID and a folder name.
public static Permission GetPermissionByID(string userID, string folderName)

Parameters

userID string
The user ID.
folderName string
The fodler name.

Returns

Permission
Retrieved permission or Nothing if permission can not be retrieved.

GetPermissionBySql(string)

Retrieves a permission according to provided SQL statement.
public static Permission GetPermissionBySql(string sql)

Parameters

sql string
SQL statement to be used to retrieve a permission.

Returns

Permission
Retrieved the permission.

GetRestrictedFolders()

Gets restricted folders.
public static HashSet<string> GetRestrictedFolders()

Returns

HashSet<string>
The HashSet(Of String).

HasAccess(string)

Determines whether a user has access to a folder or not.
[Obsolete("Use HasReadAccess() method instead.")]
public static bool HasAccess(string folderName)

Parameters

folderName string
Name of the folder.

Returns

bool
true if current user has access to a folder; otherwise, false.

HasAccessFrontend(string)

Determines whether a user has access to an extranet folder or not.
public static bool HasAccessFrontend(string folderName)

Parameters

folderName string
Name of the extranet folder.

Returns

bool
true if current user has access to a folder; otherwise, false.

HasAccessFunction(string, string)

Determines whether a identity has read access to a element in FileManager or not.
public static bool HasAccessFunction(string elType, string elName)

Parameters

elType string
Type of the element
elName string
Name of the element

Returns

bool
true if identity has read access to element; otherwise, false.

HasAccessToSecureFolder(string)

public static bool HasAccessToSecureFolder(string path)

Parameters

path string

Returns

bool

HasReadAccess(string)

Determines whether a user has read access to a specified folder.
public static bool HasReadAccess(string folderName)

Parameters

folderName string
Name of the folder.

Returns

bool
true if user has read access to a specified folder; otherwise, false.

HasRestrictedContent(string, ref bool)

Determines whether a folder has restricted content or not.
public static bool HasRestrictedContent(string requestedFolder, ref bool returnValue)

Parameters

requestedFolder string
The requested folder.
returnValue bool
The returning value. Should be false.

Returns

bool
true if a folder has restricted content; otherwise, false.

HasWriteAccess(string)

Determines whether user has write access to specified folder.
public static bool HasWriteAccess(string folderName)

Parameters

folderName string
Name of the folder.

Returns

bool
true if user has write access the specified folder; otherwise, false.

MovePermissions(DirectoryInfo, DirectoryInfo, string, bool)

Moves the permissions of the current folder and its subfolders.
public static void MovePermissions(DirectoryInfo source, DirectoryInfo target, string root, bool withPermissions)

Parameters

source DirectoryInfo
target DirectoryInfo
root string
withPermissions bool

Save()

Saves current permissions.
public bool Save()

Returns

bool
True if the permission was saved, otherwise false.
To top