Table: dbo.Privilege
Columns
NameTypeConstraintsDescription
privilege_KEYint (4)NOT NULLDatabase assigned primary key for this table.
parent__privilege_KEYint (4)NOT NULLForeign key to the parent of this Privilege.
codenvarchar (30)NOT NULLThis is a shorter version of Description that is used for the privilege path.
descriptionnvarchar (120)NOT NULLThis is the description that users will see.
sortint (4)NOT NULLIt is required that the privileges sort in a particular order. This is how the order is specified.
leaftinyint (1)NOT NULL1 if this is a privilege and 0 if it is a privilege folder.
tree_levelint (4)NOT NULLThe level in the tree.
hierarchynvarchar (900)NOT NULLCalculated by the database to allow privileges to be sorted quickly in tree structure.
sort_hierarchynvarchar (900)NOT NULLSame as Hierarchy except that the values from Sort column are used.
Primary key
NameColumnsDescription
PK_Privilegeprivilege_KEY
Unique constraints
NameColumnsDescription
UK_Privilege$hierarchyhierarchy
UK_Privilege$sort_hierarchysort_hierarchy
Foreign keys
NameColumnsReferenced tableDescription
FK_Privilege__Privilege__parent__privilege_KEYparent__privilege_KEYPrivilege (privilege_KEY)
Incoming foreign keys
NameColumnsReferencing tableDescription
FK_Privilege__Privilege__parent__privilege_KEYparent__privilege_KEYPrivilege
FK_Synchronized_Privilege__Privilege__privilege_KEYprivilege_KEYSynchronized_Privilege
FK_Privilege_Forbidden__Privilege__privilege_KEYprivilege_KEYPrivilege_Forbidden
FK_Privilege_Dependency__Privilege__dependent__privilege_KEYdependent__privilege_KEYPrivilege_Dependency
FK_Privilege_Dependency__Privilege__privilege_KEYprivilege_KEYPrivilege_Dependency

Schema diagram