• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ISecurityObjectId类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ISecurityObjectId的典型用法代码示例。如果您正苦于以下问题:C# ISecurityObjectId类的具体用法?C# ISecurityObjectId怎么用?C# ISecurityObjectId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ISecurityObjectId类属于命名空间,在下文中一共展示了ISecurityObjectId类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: InheritFrom

		public ISecurityObjectId InheritFrom(ISecurityObjectId objectId) {
			if (objectId.ObjectType == type1) {
				if (objectId.SecurityId.Equals(2)) return new SecurityObjectId(1, type1);
			}

			return null;
		}
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:7,代码来源:Class1.cs


示例2: InheritFrom

        public ISecurityObjectId InheritFrom(ISecurityObjectId objectId)
        {
            int contactId;
            int entityId;
            EntityType entityType;

            if (objectId is Task)
            {
                var task = (Task)objectId;

                contactId = task.ContactID;
                entityId = task.EntityID;
                entityType = task.EntityType;
            }
            else if (objectId is RelationshipEvent)
            {
                var eventObj = (RelationshipEvent)objectId;

                contactId = eventObj.ContactID;
                entityId = eventObj.EntityID;
                entityType = eventObj.EntityType;
                
            }
            else
            {
                return null;
            }

            if (entityId == 0 && contactId == 0) return null;

            if (entityId == 0)
            return new Company
                {
                    ID = contactId,
                    CompanyName = "fakeCompany"
                };
                
                //   return _daoFactory.GetContactDao().GetByID(contactId);

            switch (entityType)
            {

                case EntityType.Opportunity:
                    return new Deal
                        {
                            ID = entityId,
                            Title = "fakeDeal"
                        };
                   // return _daoFactory.GetDealDao().GetByID(entityId);
                case EntityType.Case:
                    return new Cases
                        {
                            ID = entityId, 
                            Title = "fakeCases"
                        };
                  //  return _daoFactory.GetCasesDao().GetByID(entityId);
            }

            return null;
        }
开发者ID:haoasqui,项目名称:ONLYOFFICE-Server,代码行数:60,代码来源:CRMSecurityObjectProvider.cs


示例3: RemoveAllAces

 public void RemoveAllAces(ISecurityObjectId id)
 {
     foreach (var r in GetAces(Guid.Empty, Guid.Empty, id).ToArray())
     {
         RemoveAce(r);
     }
 }
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:7,代码来源:ClientAzManager.cs


示例4: GetDenyActions

        private DenyResult[] GetDenyActions(ISubject subject, IAction[] actions, ISecurityObjectId objectId, ISecurityObjectProvider securityObjProvider)
        {
            var denyActions = new List<DenyResult>();
            if (actions == null) actions = new IAction[0];

            if (subject == null)
            {
                denyActions = actions.Select(a => new DenyResult(a, null, null)).ToList();
            }
            else if (subject is ISystemAccount && subject.ID == Constants.CoreSystem.ID)
            {
                // allow all
            }
            else
            {
                ISubject denySubject = null;
                IAction denyAction = null;
                foreach (var action in actions)
                {
                    var allow = azManager.CheckPermission(subject, action, objectId, securityObjProvider, out denySubject, out denyAction);
                    if (!allow)
                    {
                        denyActions.Add(new DenyResult(action, denySubject, denyAction));
                        break;
                    }
                }
            }
            return denyActions.ToArray();
        }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:29,代码来源:PermissionResolver.cs


示例5: GetObjectRoles

        public IEnumerable<IRole> GetObjectRoles(ISubject account, ISecurityObjectId objectId, SecurityCallContext callContext)
        {
 
          //   Constants.Everyone
          // if (_daoFactory.GetManagerDao().GetAll(false).Contains(ASC.Core.CoreContext.UserManager.GetUsers(account.ID)))
          //   return new Action[]
            throw new NotImplementedException();
        }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:8,代码来源:CRMSecurityObjectProvider.cs


示例6: InheritFrom

        public ISecurityObjectId InheritFrom(ISecurityObjectId objectId)
        {
            int calId;
            if (int.TryParse(this.CalendarId, out calId))
                return new Calendar() { Id = this.CalendarId };

            return null;
        }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:8,代码来源:Event.cs


示例7: GetObjectRoles

        public IEnumerable<ASC.Common.Security.Authorizing.IRole> GetObjectRoles(ASC.Common.Security.Authorizing.ISubject account, ISecurityObjectId objectId, SecurityCallContext callContext)
        {
            List<IRole> roles = new List<IRole>();
            if (account.ID.Equals(this.OwnerId))
                roles.Add(ASC.Common.Security.Authorizing.Constants.Owner);

            return roles;
        }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:8,代码来源:Event.cs


示例8: IsPrivate

        private static bool IsPrivate(ISecurityObjectId entity)
        {

            var entityAces = CoreContext.AuthorizationManager.GetAcesWithInherits(Guid.Empty, _actionRead.ID, entity, GetCRMSecurityProvider());

            return entityAces.Count() > 1;

        }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:8,代码来源:CRMSecutiry.cs


示例9: GetObjectRoles

		public IEnumerable<IRole> GetObjectRoles(ISubject account, ISecurityObjectId objectId, SecurityCallContext callContext)
		{
			var roles = new List<IRole>();
			if (Equals(account.ID, this.UserID))
			{
				roles.Add(Constants.Owner);
			}
			return roles;
		}
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:9,代码来源:Event.cs


示例10: GetObjectRoles

 public IEnumerable<IRole> GetObjectRoles(ISubject account, ISecurityObjectId objectId, SecurityCallContext callContext)
 {
     var roles = new List<IRole>();
     if (blogOwner != null && blogOwner.ID.Equals(account.ID))
     {
         roles.Add(ASC.Common.Security.Authorizing.Constants.Owner);
     }
     return roles;
 }
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:9,代码来源:PersonalBlogSecObject.cs


示例11: GetAcl

        public IEnumerable<Ace> GetAcl(ISubject subject, IAction action, ISecurityObjectId objectId, ISecurityObjectProvider secObjProvider)
        {
            if (subject == null) throw new ArgumentNullException("subject");
            if (action == null) throw new ArgumentNullException("action");

            return CoreContext.AuthorizationManager
                .GetAcesWithInherits(subject.ID, action.ID, objectId, secObjProvider)
                .Select(r => new Ace(r.ActionId, r.Reaction));
        }
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:9,代码来源:PermissionProvider.cs


示例12: GetObjectRoles

        public IEnumerable<ASC.Common.Security.Authorizing.IRole> GetObjectRoles(ASC.Common.Security.Authorizing.ISubject account, ISecurityObjectId objectId, SecurityCallContext callContext)
        {
            var roles = new List<IRole>();

            if (!Guid.Empty.Equals(Object.OwnerID) && Object.OwnerID.Equals(account.ID))
            {
                roles.Add(ASC.Common.Security.Authorizing.Constants.Owner);
            }

            return roles;
        }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:11,代码来源:WikiObjectsSecurityObject.cs


示例13: CheckPermission

        public bool CheckPermission(ISubject subject, IAction action, ISecurityObjectId objectId,
                                    ISecurityObjectProvider securityObjProvider, out ISubject denySubject,
                                    out IAction denyAction)
        {
            if (subject == null) throw new ArgumentNullException("subject");
            if (action == null) throw new ArgumentNullException("action");

            var acl = GetAzManagerAcl(subject, action, objectId, securityObjProvider);
            denySubject = acl.DenySubject;
            denyAction = acl.DenyAction;
            return acl.IsAllow;
        }
开发者ID:haoasqui,项目名称:ONLYOFFICE-Server,代码行数:12,代码来源:AzManager.cs


示例14: Demand

 public void Demand(ISubject subject, ISecurityObjectId objectId, ISecurityObjectProvider securityObjProvider, params IAction[] actions)
 {
     var denyActions = GetDenyActions(subject, actions, objectId, securityObjProvider);
     if (0 < denyActions.Length)
     {
         throw new AuthorizingException(
             subject,
             Array.ConvertAll(denyActions, r => r.TargetAction),
             Array.ConvertAll(denyActions, r => r.DenySubject),
             Array.ConvertAll(denyActions, r => r.DenyAction));
     }
 }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:12,代码来源:PermissionResolver.cs


示例15: AzObjectSecurityProviderHelper

 public AzObjectSecurityProviderHelper(ISecurityObjectId objectId, ISecurityObjectProvider secObjProvider)
 {
     if (objectId == null) throw new ArgumentNullException("objectId");
     currObjIdAsProvider = false;
     currObjId = objectId;
     currSecObjProvider = secObjProvider;
     if (currSecObjProvider == null && currObjId is ISecurityObjectProvider)
     {
         currObjIdAsProvider = true;
         currSecObjProvider = (ISecurityObjectProvider) currObjId;
     }
     callContext = new SecurityCallContext();
 }
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:13,代码来源:AzObjectSecurityProviderHelper.cs


示例16: GetObjectRoles

		public IEnumerable<IRole> GetObjectRoles(ISubject account, ISecurityObjectId objectId, SecurityCallContext callContext) {
			var roles = new List<IRole>();

			if (objectId.ObjectType == type1) {
				if (objectId.SecurityId.Equals(1) && account.Equals(Domain.accountNik)) {
					roles.Add(Constants.Owner);
					roles.Add(Constants.Self);
				}
				if (objectId.SecurityId.Equals(3) && account.Equals(Domain.accountAnton)) {
					roles.Add(Constants.Owner);
				}
			}

			return roles;
		}
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:15,代码来源:Class1.cs


示例17: GetObjectRoles

        public IEnumerable<IRole> GetObjectRoles(ISubject account, ISecurityObjectId objectId, SecurityCallContext callContext)
        {
            var roles = new List<IRole>();

            var userGroups = new List<GroupInfo>(
                CoreContext.UserManager.GetUserGroups(account.ID, IncludeType.Distinct | IncludeType.InChild)
            );

            if (userGroups.Contains(groupInfo))
            {
                roles.Add(ASC.Common.Security.Authorizing.Constants.Member);
            }

            return roles;
        }
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:15,代码来源:CorporateBlogSecObject.cs


示例18: CheckPermissions

        public static bool CheckPermissions(ISecurityObjectId objectId, ISecurityObjectProvider securityObjProvider, params IAction[] actions)
        {
            if (IsAdministrator()) return true;
            if (IsOutsider())
            {
                var actionArray = actions ?? new IAction[0];
                var containsReadAction = false;
                foreach (var action in actionArray)
                {
                    containsReadAction = action.ID.Equals(new Guid("{E0759A42-47F0-4763-A26A-D5AA665BEC35}"));//"Read forum post action"
                }
                if (!containsReadAction) return false;
            }

            return SecurityContext.CheckPermissions(objectId, securityObjProvider, actions);
        }
开发者ID:vipwan,项目名称:CommunityServer,代码行数:16,代码来源:CommunitySecurity.cs


示例19: GetSubjects

 internal IEnumerable<ISubject> GetSubjects(ISubject subject, ISecurityObjectId objectId, ISecurityObjectProvider securityObjProvider)
 {
     var subjects = new List<ISubject>();
     subjects.Add(subject);
     subjects.AddRange(
         roleProvider.GetRoles(subject)
             .ConvertAll(r => { return (ISubject)r; })
         );
     if (objectId != null)
     {
         var secObjProviderHelper = new AzObjectSecurityProviderHelper(objectId, securityObjProvider);
         do
         {
             if (!secObjProviderHelper.ObjectRolesSupported) continue;
             foreach (IRole role in secObjProviderHelper.GetObjectRoles(subject))
             {
                 if (!subjects.Contains(role)) subjects.Add(role);
             }
         } while (secObjProviderHelper.NextInherit());
     }
     return subjects;
 }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:22,代码来源:AzManager.cs


示例20: InheritFrom

        public ISecurityObjectId InheritFrom(ISecurityObjectId objectId)
        {
            if (!(objectId is Task)) return null;

            var task = (Task)objectId;

            if (task.EntityID == 0 && task.ContactID == 0) return null;

            if (task.EntityID == 0)
                return _daoFactory.GetContactDao().GetByID(task.ContactID);

            switch (task.EntityType)
            {

                case EntityType.Opportunity:
                    return _daoFactory.GetDealDao().GetByID(task.EntityID);
                case EntityType.Case:
                    return _daoFactory.GetCasesDao().GetByID(task.EntityID);
            }

            return null;
        }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:22,代码来源:CRMSecurityObjectProvider.cs



注:本文中的ISecurityObjectId类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ISecurityProvider类代码示例发布时间:2022-05-24
下一篇:
C# ISecurityManager类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap