C# Class SobekCM.Core.Users.User_Object

Represents a single mySobek user, including personal information, permissions, and preferences.
显示文件 Open project: MarkVSullivan/SobekCM-Web-Application Class Usage Examples

Public Methods

Method Description
Add_Aggregation ( string Code, string Name, bool CanSelect, bool CanEditMetadata, bool CanEditBehaviors, bool CanPerformQc, bool CanUploadFiles, bool CanChangeVisibility, bool CanDelete, bool IsCurator, bool OnHomePage, bool IsAdmin, bool GroupDefined ) : void

Add a new item aggregation to this user's collection of item aggregationPermissions

Add_BibID ( string BibID ) : void

Adds a BibID to the list of bibid's this user can edit

Add_Bookshelf_Item ( string BibID, string VID ) : void

Add an item to the list of items on the bookshelf for this user

Add_Default_Metadata_Set ( string MetadataSet, bool Group_Defined ) : void

Adds a default metadata set to the list of sets this user can select

This must match the name of one of the project METS (.pmets) files in the mySobek\projects folder

Add_Editable_Regular_Expression ( string Regular_Expression ) : void

Adds a regular expression to this user to determine which titles this user can edit

Add_Folder ( User_Folder Folder ) : void

Adds a folder to the list of folders associated with this user

Add_Folder ( string Folder_Name, int Folder_ID ) : void

Adds a folder name to the list of folders associated with this user

Add_Setting ( string Option_Key, object Option_Value ) : void

Add a new user option

Add_Setting ( string Option_Key, object Option_Value, bool Update_Database ) : void

Add a new user option

Add_Template ( string Template, bool Group_Defined ) : void

Adds a template to the list of templates this user can select

This must match the name of one of the template XML files in the mySobek\templates folder

Add_User_Group ( string GroupName ) : void

Adds a user group to the list of user groups this user belongs to

Can_Delete_This_Item ( string BibID, string SourceCode, string HoldingCode, ICollection Aggregations ) : bool

Determines if this user can edit this item, based on several different criteria

Can_Edit_All_Items ( string AggregationCode ) : bool

Checks to see if this user can edit all the items within this aggregation

Can_Edit_This_Item ( string BibID, string ItemType, string SourceCode, string HoldingCode, ICollection Aggregations ) : bool

Determines if this user can edit this item, based on several different criteria

Clear_Aggregations ( ) : void

Clear the list of aggregation permissions associated with this user

Clear_Default_Metadata_Sets ( ) : void

Clears all default metadata sets associated with this user

Clear_Folders ( ) : void

Clear all the folders linked to this user object

Clear_Templates ( ) : void

Clears the list of templates associated with this user

Clear_UserGroup_Membership ( ) : void

Clear all the user groups associated with this user

DES_EncryptString ( string Source, string Key, string Iv ) : string

Encrypt a string, given the string.

Folder_Name ( string NameVersion ) : string

This checks that the folder name exists, and returns the proper format

Get_Folder ( string Folder_Name ) : User_Folder

Get a folder obejct by folder name

Get_Setting ( string Option_Key, int Default_Value ) : int

Get the user option as an integer, by option key

Get_Setting ( string Option_Key ) : object

Get the user option as an object, by option key

Get_Setting ( string Option_Key, string Default_Value ) : string

Get the user option as a string, by option key

Get_Value_By_Mapping ( User_Object_Attribute_Mapping_Enum Mapping ) : string

Gets a value from this user object, based on the user object attribute mapping enumeration

Is_Aggregation_Admin ( string AggregationCode ) : bool

Checks to see if this user can perform administrative tasks against an item aggregation

Is_Aggregation_Curator ( string AggregationCode ) : bool

Checks to see if this user can perform curatorial tasks against an item aggregation

Is_In_Bookshelf ( string BibID, string VID ) : bool

Checks to see if an item exists in this user's bookshelf

Is_On_Home_Page ( string AggregationCode ) : bool

Checks to see if an aggregation is currently listed on the user's personalized home page

Remove_Folder ( string Folder_Name ) : void

Removes a folder name from the list of folders associated with this user

Remove_From_Bookshelves ( string BibID, string VID ) : void

Removes an item from the list of items in the user's bookshelves

Security_Hash ( string IP ) : string

Returns the security hash based on IP for this user

This is used to add another level of security on cookies coming in from a user request

Set_Aggregation_Home_Page_Flag ( string Code, string Name, bool Flag ) : void

Sets the flag that a particular aggregation exists on this user's home page

Set_Current_Default_Metadata ( string MetadataSet ) : void

Sets the current default metadata set for this user

This only sets this as the default metadata set if it currently exists in the list of possible projects for this uers

Set_Default_Template ( string Template ) : void

Sets the default template for this user

This only sets this as the default template if it currently exists in the list of possible templates for this uers

Set_Value_By_Mapping ( User_Object_Attribute_Mapping_Enum Mapping, string Value ) : void

Set a value on this user object, based on the user object attribute mapping enumeration

User_Object ( ) : System

Constructor for a new instance of the User_Object class

Private Methods

Method Description
recurse_through_children ( User_Folder ParentFolder, User_Folder>.SortedList FolderBuilder ) : void
recurse_to_get_folder ( User_Folder ParentFolder, string FolderName ) : User_Folder

Method Details

Add_Aggregation() public method

Add a new item aggregation to this user's collection of item aggregationPermissions
public Add_Aggregation ( string Code, string Name, bool CanSelect, bool CanEditMetadata, bool CanEditBehaviors, bool CanPerformQc, bool CanUploadFiles, bool CanChangeVisibility, bool CanDelete, bool IsCurator, bool OnHomePage, bool IsAdmin, bool GroupDefined ) : void
Code string Code for this user editable item aggregation
Name string Name for this user editable item aggregation
CanSelect bool Flag indicates if this user can add items to this item aggregation
CanEditMetadata bool Flag indicates if the user can edit metadata for all items in this aggregation
CanEditBehaviors bool Flag indicates if the user can edit behaviors for all items in this aggregation
CanPerformQc bool Flag indicates if the user can edit perform quality control for all items in this aggregation
CanUploadFiles bool Flag indicates if the user can edit upload files for all items in this aggregation
CanChangeVisibility bool Flag indicates if the user can change the visibility for all items in this aggregation
CanDelete bool Flag indicates if the user can delete items in this aggregation
IsCurator bool Flag indicates if this user is listed as the curator or collection manager for this given digital aggregation
OnHomePage bool Flag indicates if this user has asked to have this aggregation appear on their personalized home page
IsAdmin bool Flag indicates if this user is listed athe admin for this aggregation
GroupDefined bool Flag indicates if these permissions are derived from the group
return void

Add_BibID() public method

Adds a BibID to the list of bibid's this user can edit
public Add_BibID ( string BibID ) : void
BibID string New BibID this user can edit
return void

Add_Bookshelf_Item() public method

Add an item to the list of items on the bookshelf for this user
public Add_Bookshelf_Item ( string BibID, string VID ) : void
BibID string Bibliographic identifier (BibID) for this item
VID string Volume identifier (VID) for this item
return void

Add_Default_Metadata_Set() public method

Adds a default metadata set to the list of sets this user can select
This must match the name of one of the project METS (.pmets) files in the mySobek\projects folder
public Add_Default_Metadata_Set ( string MetadataSet, bool Group_Defined ) : void
MetadataSet string Code for this default metadata set
Group_Defined bool Defined at the user group level (versus at the instance level)
return void

Add_Editable_Regular_Expression() public method

Adds a regular expression to this user to determine which titles this user can edit
public Add_Editable_Regular_Expression ( string Regular_Expression ) : void
Regular_Expression string Regular expression used to compute if this user can edit a title, by BibID
return void

Add_Folder() public method

Adds a folder to the list of folders associated with this user
public Add_Folder ( User_Folder Folder ) : void
Folder User_Folder Built folder object
return void

Add_Folder() public method

Adds a folder name to the list of folders associated with this user
public Add_Folder ( string Folder_Name, int Folder_ID ) : void
Folder_Name string Name of the folder to add
Folder_ID int Primary key for this folder
return void

Add_Setting() public method

Add a new user option
public Add_Setting ( string Option_Key, object Option_Value ) : void
Option_Key string Key for the user option
Option_Value object Value for this user option
return void

Add_Setting() public method

Add a new user option
public Add_Setting ( string Option_Key, object Option_Value, bool Update_Database ) : void
Option_Key string Key for the user option
Option_Value object Value for this user option
Update_Database bool Flag indicates if the database should be updated
return void

Add_Template() public method

Adds a template to the list of templates this user can select
This must match the name of one of the template XML files in the mySobek\templates folder
public Add_Template ( string Template, bool Group_Defined ) : void
Template string Code for this template
Group_Defined bool Indicates if this user has permissions to use this tempate through group membership
return void

Add_User_Group() public method

Adds a user group to the list of user groups this user belongs to
public Add_User_Group ( string GroupName ) : void
GroupName string Name of the user group
return void

Can_Delete_This_Item() public method

Determines if this user can edit this item, based on several different criteria
public Can_Delete_This_Item ( string BibID, string SourceCode, string HoldingCode, ICollection Aggregations ) : bool
BibID string BibID for the item to check
SourceCode string Source code for the item
HoldingCode string Holding code for the item
Aggregations ICollection List of all aggregations codes linked to the item
return bool

Can_Edit_All_Items() public method

Checks to see if this user can edit all the items within this aggregation
public Can_Edit_All_Items ( string AggregationCode ) : bool
AggregationCode string Code for this item aggregation
return bool

Can_Edit_This_Item() public method

Determines if this user can edit this item, based on several different criteria
public Can_Edit_This_Item ( string BibID, string ItemType, string SourceCode, string HoldingCode, ICollection Aggregations ) : bool
BibID string BibID for the item
ItemType string Type of the item
SourceCode string Source code for the item
HoldingCode string Holding code for the item
Aggregations ICollection List of all aggregations codes linked to the item
return bool

Clear_Aggregations() public method

Clear the list of aggregation permissions associated with this user
public Clear_Aggregations ( ) : void
return void

Clear_Default_Metadata_Sets() public method

Clears all default metadata sets associated with this user
public Clear_Default_Metadata_Sets ( ) : void
return void

Clear_Folders() public method

Clear all the folders linked to this user object
public Clear_Folders ( ) : void
return void

Clear_Templates() public method

Clears the list of templates associated with this user
public Clear_Templates ( ) : void
return void

Clear_UserGroup_Membership() public method

Clear all the user groups associated with this user
public Clear_UserGroup_Membership ( ) : void
return void

DES_EncryptString() public static method

Encrypt a string, given the string.
public static DES_EncryptString ( string Source, string Key, string Iv ) : string
Source string String to encrypt
Key string Key for the encryption
Iv string Initialization Vector for the encryption
return string

Folder_Name() public method

This checks that the folder name exists, and returns the proper format
public Folder_Name ( string NameVersion ) : string
NameVersion string Version of the folder name to check
return string

Get_Folder() public method

Get a folder obejct by folder name
public Get_Folder ( string Folder_Name ) : User_Folder
Folder_Name string Name of the folder object to retrieve
return User_Folder

Get_Setting() public method

Get the user option as an integer, by option key
public Get_Setting ( string Option_Key, int Default_Value ) : int
Option_Key string Key for the user option
Default_Value int Default value to return, if no value is present
return int

Get_Setting() public method

Get the user option as an object, by option key
public Get_Setting ( string Option_Key ) : object
Option_Key string Key for the user option
return object

Get_Setting() public method

Get the user option as a string, by option key
public Get_Setting ( string Option_Key, string Default_Value ) : string
Option_Key string Key for the user option
Default_Value string Default value to return, if no value is present
return string

Get_Value_By_Mapping() public method

Gets a value from this user object, based on the user object attribute mapping enumeration
public Get_Value_By_Mapping ( User_Object_Attribute_Mapping_Enum Mapping ) : string
Mapping User_Object_Attribute_Mapping_Enum Field to get from this user object
return string

Is_Aggregation_Admin() public method

Checks to see if this user can perform administrative tasks against an item aggregation
public Is_Aggregation_Admin ( string AggregationCode ) : bool
AggregationCode string Code for this item aggregation
return bool

Is_Aggregation_Curator() public method

Checks to see if this user can perform curatorial tasks against an item aggregation
public Is_Aggregation_Curator ( string AggregationCode ) : bool
AggregationCode string Code for this item aggregation
return bool

Is_In_Bookshelf() public method

Checks to see if an item exists in this user's bookshelf
public Is_In_Bookshelf ( string BibID, string VID ) : bool
BibID string BibID for this item in a bookshelf
VID string VID for this item in a bookshelf
return bool

Is_On_Home_Page() public method

Checks to see if an aggregation is currently listed on the user's personalized home page
public Is_On_Home_Page ( string AggregationCode ) : bool
AggregationCode string Code for this item aggregation
return bool

Remove_Folder() public method

Removes a folder name from the list of folders associated with this user
public Remove_Folder ( string Folder_Name ) : void
Folder_Name string Name of the folder to remove
return void

Remove_From_Bookshelves() public method

Removes an item from the list of items in the user's bookshelves
public Remove_From_Bookshelves ( string BibID, string VID ) : void
BibID string BibID for this item in a bookshelf
VID string VID for this item in a bookshelf
return void

Security_Hash() public method

Returns the security hash based on IP for this user
This is used to add another level of security on cookies coming in from a user request
public Security_Hash ( string IP ) : string
IP string IP Address for this user request
return string

Set_Aggregation_Home_Page_Flag() public method

Sets the flag that a particular aggregation exists on this user's home page
public Set_Aggregation_Home_Page_Flag ( string Code, string Name, bool Flag ) : void
Code string Code for this item aggregation
Name string Name of this item aggregation
Flag bool New flag
return void

Set_Current_Default_Metadata() public method

Sets the current default metadata set for this user
This only sets this as the default metadata set if it currently exists in the list of possible projects for this uers
public Set_Current_Default_Metadata ( string MetadataSet ) : void
MetadataSet string Code for this default metadata set
return void

Set_Default_Template() public method

Sets the default template for this user
This only sets this as the default template if it currently exists in the list of possible templates for this uers
public Set_Default_Template ( string Template ) : void
Template string Code for this template
return void

Set_Value_By_Mapping() public method

Set a value on this user object, based on the user object attribute mapping enumeration
public Set_Value_By_Mapping ( User_Object_Attribute_Mapping_Enum Mapping, string Value ) : void
Mapping User_Object_Attribute_Mapping_Enum Field to set in this user object
Value string Value to set that field to
return void

User_Object() public method

Constructor for a new instance of the User_Object class
public User_Object ( ) : System
return System