本文整理汇总了C#中PermissionInfo类的典型用法代码示例。如果您正苦于以下问题:C# PermissionInfo类的具体用法?C# PermissionInfo怎么用?C# PermissionInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PermissionInfo类属于命名空间,在下文中一共展示了PermissionInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SecurityGrid
public SecurityGrid(DotNetNuke.Entities.Portals.PortalSettings ps, bool isReadOnly, string imgPath, PermissionInfo sec, int permId)
{
PortalSettings = ps;
ReadOnly = isReadOnly;
ImagePath = imgPath;
Security = sec;
PermissionsId = permId;
}
开发者ID:allanedk,项目名称:ActiveForums,代码行数:8,代码来源:SecurityGrid.cs
示例2: ModulePermissionInfo
public ModulePermissionInfo(PermissionInfo permission)
: this()
{
this.ModuleDefID = permission.ModuleDefID;
this.PermissionCode = permission.PermissionCode;
this.PermissionID = permission.PermissionID;
this.PermissionKey = permission.PermissionKey;
this.PermissionName = permission.PermissionName;
}
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:9,代码来源:ModulePermissionInfo.cs
示例3: AddPermissions
/// <summary>
/// 递归加载所有权限
/// </summary>
/// <param name="rootPermission"></param>
/// <param name="permission"></param>
private void AddPermissions(PermissionInfo rootPermission, Permission permission)
{
var permissions = PermissionInfos.Where(p => p.ParentName == rootPermission.Name);
foreach (PermissionInfo permissionInfo in permissions)
{
var childernPermission = permission.CreateChildPermission(permissionInfo.Name,
new FixedLocalizableString(permissionInfo.DisplayName), permissionInfo.IsGrantedByDefault);
AddPermissions(permissionInfo, childernPermission);
}
}
开发者ID:fzrain,项目名称:Material-Design-AngularJs-Abp,代码行数:15,代码来源:FzrainAuthorizationProvider.cs
示例4: AddPermission
public void AddPermission(string principal, PermissionInfo permission)
{
if (HasPrincipal(principal))
{
if (!permissions.Keys.Contains(this[principal]))
permissions.Add(this[principal], new PermissionInfoCollection());
permissions[this[principal]].Add(permission);
}
else
throw new ArgumentException("you must add " + principal + " user!");
}
开发者ID:skyduoduo,项目名称:crystalwall,代码行数:11,代码来源:MemeryPrincipalTokenProvider.cs
示例5: Contains
public override bool Contains(PermissionInfo permission)
{
if (permission == null)
return false;
switch(LogicPoint)
{
case LogicPoint.AND:
default:
return left.Contains(permission) && right.Contains(permission);
case LogicPoint.OR:
return left.Contains(permission) || right.Contains(permission);
}
}
开发者ID:vincentvalenlee,项目名称:XCRM,代码行数:13,代码来源:LogicPermissionInfo.cs
示例6: Contains
public override bool Contains(PermissionInfo permission)
{
DefaultPermissionInfo tp = permission as DefaultPermissionInfo;
if (tp == null)
return false;
if (!CompareName(tp))
{
return false;
}
else
{
return CompareAction(tp);
}
}
开发者ID:hitechie,项目名称:IocCore,代码行数:14,代码来源:DefaultPermissionInfo.cs
示例7: GetEnabled
/// <summary>
/// Gets the Enabled status of the permission
/// </summary>
/// <param name="objPerm">The permission being loaded</param>
/// <param name="role">The role</param>
/// <param name="column">The column of the Grid</param>
protected override bool GetEnabled( PermissionInfo objPerm, RoleInfo role, int column )
{
bool enabled;
if( role.RoleID == AdministratorRoleId )
{
enabled = false;
}
else
{
enabled = true;
}
return enabled;
}
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:21,代码来源:TabPermissionsGrid.cs
示例8: AddModulePermission
private ModulePermissionInfo AddModulePermission(ModuleInfo objModule, PermissionInfo permission, int roleId, int userId, bool allowAccess)
{
ModulePermissionInfo objModulePermission = new ModulePermissionInfo();
objModulePermission.ModuleID = objModule.ModuleID;
objModulePermission.PermissionID = permission.PermissionID;
objModulePermission.RoleID = roleId;
objModulePermission.UserID = userId;
objModulePermission.PermissionKey = permission.PermissionKey;
objModulePermission.AllowAccess = allowAccess;
if (!objModule.ModulePermissions.Contains(objModulePermission))
{
objModule.ModulePermissions.Add(objModulePermission);
}
return objModulePermission;
}
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:15,代码来源:ControlPanelBase.cs
示例9: Contains
public override bool Contains(PermissionInfo permission)
{
if (permission is OrgPermission)
{
return base.Contains(permission);
}
else if (permission is FilePermissionInfo)
{
FilePermissionInfo fp = permission as FilePermissionInfo;
if (fp.Name.IndexOf(RES_TAG) != -1)
{
fp = new FilePermissionInfo(fp.Name.Substring(0, fp.Name.IndexOf(RES_TAG)), fp.Action);
return base.Contains(fp);
}
else if (fp.Name.StartsWith(this.name) )
{
return (this.RealAction & fp.RealAction) == fp.RealAction;
}
}
return base.Contains(permission);
}
开发者ID:vincentvalenlee,项目名称:XCRM,代码行数:21,代码来源:OrgPermission.cs
示例10: GetEnabled
/// <summary>
/// Gets the Enabled status of the permission
/// </summary>
/// <param name="objPerm">The permission being loaded</param>
/// <param name="role">The role</param>
/// <param name="column">The column of the Grid</param>
/// <history>
/// [cnurse] 01/13/2006 Created
/// </history>
protected virtual bool GetEnabled(PermissionInfo objPerm, RoleInfo role, int column)
{
return true;
}
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:13,代码来源:PermissionsGrid.cs
示例11: IsViewPermisison
protected override bool IsViewPermisison(PermissionInfo permissionInfo)
{
return (permissionInfo.PermissionKey == "VIEW");
}
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:4,代码来源:ModulePermissionsGrid.cs
示例12: IsFullControl
protected override bool IsFullControl(PermissionInfo permissionInfo)
{
return (permissionInfo.PermissionKey == "EDIT") && PermissionProvider.Instance().SupportsFullControl();
}
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:4,代码来源:ModulePermissionsGrid.cs
示例13: GetPermission
/// -----------------------------------------------------------------------------
/// <summary>
/// Gets the Value of the permission
/// </summary>
/// <param name="objPerm">The permission being loaded</param>
/// <param name="role">The role</param>
/// <param name="column">The column of the Grid</param>
/// <param name="defaultState">Default State.</param>
/// <returns>A Boolean (True or False)</returns>
/// -----------------------------------------------------------------------------
protected override string GetPermission(PermissionInfo objPerm, RoleInfo role, int column, string defaultState)
{
string permission;
if (InheritViewPermissionsFromTab && column == _ViewColumnIndex)
{
permission = PermissionTypeNull;
}
else
{
permission = role.RoleID == AdministratorRoleId
? PermissionTypeGrant
: base.GetPermission(objPerm, role, column, defaultState);
}
return permission;
}
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:25,代码来源:ModulePermissionsGrid.cs
示例14: GetEnabled
/// -----------------------------------------------------------------------------
/// <summary>
/// Gets the Enabled status of the permission
/// </summary>
/// <param name="objPerm">The permission being loaded</param>
/// <param name="user">The user</param>
/// <param name="column">The column of the Grid</param>
/// -----------------------------------------------------------------------------
protected override bool GetEnabled(PermissionInfo objPerm, UserInfo user, int column)
{
bool enabled;
if (InheritViewPermissionsFromTab && column == _ViewColumnIndex)
{
enabled = false;
}
else
{
enabled = true;
}
return enabled;
}
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:21,代码来源:ModulePermissionsGrid.cs
示例15: UpdatePermission
/// <summary>
/// Updates a Permission
/// </summary>
/// <param name="permission">The permission being updated</param>
/// <param name="roleId">Rold Id.</param>
/// <param name="roleName">The name of the role</param>
/// <param name="allowAccess">The value of the permission</param>
/// <history>
/// [cnurse] 01/12/2006 Created
/// </history>
protected virtual void UpdatePermission(PermissionInfo permission, int roleId, string roleName, bool allowAccess)
{
if (allowAccess)
{
UpdatePermission(permission, roleId, roleName, PermissionTypeGrant);
}
else
{
UpdatePermission(permission, roleId, roleName, PermissionTypeNull);
}
}
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:21,代码来源:PermissionsGrid.cs
示例16: GetPermission
/// <summary>
/// Gets the Value of the permission
/// </summary>
/// <param name="objPerm">The permission being loaded</param>
/// <param name="user">The user</param>
/// <param name="column">The column of the Grid</param>
/// <param name="defaultState">Default State.</param>
/// <history>
/// [cnurse] 01/13/2006 Created
/// </history>
protected virtual string GetPermission(PermissionInfo objPerm, UserInfo user, int column, string defaultState)
{
var stateKey = defaultState;
if (PermissionsList != null)
{
foreach (var permission in PermissionsList)
{
if (permission.PermissionID == objPerm.PermissionID && permission.UserID == user.UserID)
{
if (permission.AllowAccess)
{
stateKey = PermissionTypeGrant;
}
else
{
stateKey = PermissionTypeDeny;
}
break;
}
}
}
return stateKey;
}
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:33,代码来源:PermissionsGrid.cs
示例17: GetEnabled
/// -----------------------------------------------------------------------------
/// <summary>
/// Gets the Enabled status of the permission
/// </summary>
/// <param name="objPerm">The permission being loaded</param>
/// <param name="user">The user</param>
/// <param name="column">The column of the Grid</param>
/// <history>
/// [cnurse] 01/13/2006 Created
/// </history>
/// -----------------------------------------------------------------------------
protected override bool GetEnabled(PermissionInfo objPerm, UserInfo user, int column)
{
return InheritViewPermissionsFromTab && column != _ViewColumnIndex;
}
开发者ID:biganth,项目名称:Curt,代码行数:15,代码来源:ModulePermissionsGrid.cs
示例18: GetPermission
/// -----------------------------------------------------------------------------
/// <summary>
/// Gets the Value of the permission
/// </summary>
/// <param name="objPerm">The permission being loaded</param>
/// <param name="user">The role</param>
/// <param name="column">The column of the Grid</param>
/// <param name="defaultState">Default State.</param>
/// <returns>A Boolean (True or False)</returns>
/// <history>
/// [cnurse] 01/09/2006 Created
/// </history>
/// -----------------------------------------------------------------------------
protected override string GetPermission(PermissionInfo objPerm, UserInfo user, int column, string defaultState)
{
string permission;
if (InheritViewPermissionsFromTab && column == _ViewColumnIndex)
{
permission = PermissionTypeNull;
}
else
{
//Call base class method to handle standard permissions
permission = base.GetPermission(objPerm, user, column, defaultState);
}
return permission;
}
开发者ID:biganth,项目名称:Curt,代码行数:27,代码来源:ModulePermissionsGrid.cs
示例19: AddPermission
protected override void AddPermission(PermissionInfo permission, int roleId, string roleName, int userId, string displayName, bool allowAccess)
{
var objPermission = new ModulePermissionInfo(permission);
objPermission.ModuleID = ModuleID;
objPermission.RoleID = roleId;
objPermission.RoleName = roleName;
objPermission.AllowAccess = allowAccess;
objPermission.UserID = userId;
objPermission.DisplayName = displayName;
_ModulePermissions.Add(objPermission, true);
//Clear Permission List
_PermissionsList = null;
}
开发者ID:biganth,项目名称:Curt,代码行数:14,代码来源:ModulePermissionsGrid.cs
示例20: AddPermission
protected virtual void AddPermission(PermissionInfo permission, int roleId, string roleName, int userId, string displayName, bool allowAccess)
{
}
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:3,代码来源:PermissionsGrid.cs
注:本文中的PermissionInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论