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(); }
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); }
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(); }
public IEnumerable <IRole> GetObjectRoles(ISubject account, ISecurityObjectId objectId, SecurityCallContext callContext) { var roles = new List <IRole>(); if (account.ID.Equals(objectId.SecurityId)) { roles.Add(ASC.Common.Security.Authorizing.Constants.Self); } return(roles); }
/// <inheritdoc/> public IEnumerable <IRole> GetObjectRoles(ISubject account, ISecurityObjectId objectId, SecurityCallContext callContext) { return(new IRole[0]); }
public IEnumerable <IRole> GetObjectRoles(ISubject account, ISecurityObjectId objectId, SecurityCallContext callContext) { throw new NotImplementedException(); }
/// <inheritdoc/> public IEnumerable <IRole> GetObjectRoles(ISubject account, ISecurityObjectId objectId, SecurityCallContext callContext) { var roles = new List <IRole>(); if (account.ID.Equals(PosterID)) { if (callContext.ObjectsStack == null || callContext.ObjectsStack.Find(so => so.ObjectType == typeof(Post)) == null) { roles.Add(Common.Security.Authorizing.Constants.Owner); } } return(roles); }
public IEnumerable <IRole> GetObjectRoles(ISubject account, ISecurityObjectId objectId, SecurityCallContext callContext) { var roles = new List <IRole>(); if (Equals(account.ID, UserID)) { roles.Add(Common.Security.Authorizing.Constants.Owner); } return(roles); }
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); }
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); }
public IEnumerable <IRole> GetObjectRoles(ASC.Common.Security.Authorizing.ISubject account, ISecurityObjectId objectId, SecurityCallContext callContext) { return(account.ID == CreatorID ? new[] { Constants.Owner } : new IRole[0]); }