当前位置: 首页>>代码示例>>C#>>正文


C# ISecurityObjectId类代码示例

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


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


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