本文整理汇总了C#中ISecurityManager类的典型用法代码示例。如果您正苦于以下问题:C# ISecurityManager类的具体用法?C# ISecurityManager怎么用?C# ISecurityManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISecurityManager类属于命名空间,在下文中一共展示了ISecurityManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VersionAjaxService
public VersionAjaxService(Navigator navigator, ContentVersionRepository versionRepository, IWebContext webContext, ISecurityManager security)
{
_navigator = navigator;
_versionRepository = versionRepository;
_security = security;
_webContext = webContext;
}
示例2: ContentMessageSource
public ContentMessageSource(IPersister persister, IIntegrityManager integrity, ISecurityManager security, IWebContext context)
{
this.persister = persister;
this.integrity = integrity;
this.security = security;
this.context = context;
}
示例3: CreateMockSecurityManager
/// <summary>
/// 创建模拟安全管理器
/// </summary>
private void CreateMockSecurityManager() {
_mockSecurityManager = Substitute.For<ISecurityManager>();
_mockSecurityManager.IsInApplication( _userId ).Returns( true );
_mockSecurityManager.IsInTenant( _userId ).Returns( true );
_mockSecurityManager.GetPermissionsByResource( _resourceUri )
.Returns( new ResourcePermissions( _resourceUri, new List<Permission> { new Permission( _roleId,false ) } ) );
}
示例4: CommandFactory
public CommandFactory(IPersister persister, ISecurityManager security, IVersionManager versionMaker, IEditUrlManager editUrlManager, IContentAdapterProvider adapters, StateChanger changer)
{
this.persister = persister;
makeVersionOfMaster = On.Master(new MakeVersionCommand(versionMaker));
replaceMaster = new ReplaceMasterCommand(versionMaker);
makeVersion = new MakeVersionCommand(versionMaker);
useNewVersion = new UseNewVersionCommand(versionMaker);
updateObject = new UpdateObjectCommand();
delete = new DeleteCommand(persister.Repository);
showPreview = new RedirectToPreviewCommand(adapters);
showEdit = new RedirectToEditCommand(editUrlManager);
useMaster = new UseMasterCommand();
clone = new CloneCommand();
validate = new ValidateCommand();
this.security = security;
save = new SaveCommand(persister);
incrementVersionIndex = new IncrementVersionIndexCommand(versionMaker);
draftState = new UpdateContentStateCommand(changer, ContentState.Draft);
publishedState = new UpdateContentStateCommand(changer, ContentState.Published);
saveActiveContent = new ActiveContentSaveCommand();
moveToPosition = new MoveToPositionCommand();
unpublishedDate = new EnsureNotPublishedCommand();
publishedDate = new EnsurePublishedCommand();
updateReferences = new UpdateReferencesCommand();
}
示例5: AuthenticationService
public AuthenticationService(IMembershipDataSource dataSource, IUserManager userManager, ISecurityManager securityManager, IAuthenticationCookieService cookieService)
{
this._dataSource = dataSource;
this._userManager = userManager;
this._securityManager = securityManager;
this._cookieService = cookieService;
}
示例6: CommandFactory
public CommandFactory(IPersister persister, ISecurityManager security, IVersionManager versionMaker, IEditUrlManager editUrlManager, IContentAdapterProvider adapters, StateChanger changer)
{
//this.persister = persister;
//makeVersionOfMaster = On.Master(new MakeVersionCommand(versionMaker));
//showEdit = new RedirectToEditCommand(editUrlManager);
//clone = new CloneCommand();
//unpublishedDate = new EnsureNotPublishedCommand(); // moved to StateChanger
//ensurePublishedDate = new EnsurePublishedCommand(); // moved to StateChanger
this.security = security;
save = new SaveCommand(persister);
delete = new DeleteCommand(persister.Repository);
replaceMaster = new ReplaceMasterCommand(versionMaker);
makeVersion = new MakeVersionCommand(versionMaker);
useDraftCmd = new UseDraftCommand(versionMaker);
saveOnPageVersion = new SaveOnPageVersionCommand(versionMaker);
draftState = new UpdateContentStateCommand(changer, ContentState.Draft);
publishedState = new UpdateContentStateCommand(changer, ContentState.Published);
updateObject = new UpdateObjectCommand();
useMaster = new UseMasterCommand();
validate = new ValidateCommand();
saveActiveContent = new ActiveContentSaveCommand();
moveToPosition = new MoveToPositionCommand();
updateReferences = new UpdateReferencesCommand();
}
示例7: AsyncTrashPurger
public AsyncTrashPurger(IWorker worker, ITrashHandler trash, IPersister persister, ISecurityManager security)
{
this.worker = worker;
this.trash = trash;
this.persister = persister;
this.security = security;
}
示例8: MongoChatRepository
public MongoChatRepository(IConfigurationHelper configurationHelper,
ISecurityManager securityManager)
{
_configurationHelper = configurationHelper;
_securityManager = securityManager;
_database = ConnectToDatabase();
}
示例9: VimeoChannel
public VimeoChannel(IHttpClient httpClient, IJsonSerializer jsonSerializer, ILogManager logManager, ISecurityManager securityManager)
{
_httpClient = httpClient;
_logger = logManager.GetLogger(GetType().Name);
_jsonSerializer = jsonSerializer;
_securityManager = securityManager;
}
示例10: AuthorityManager
// private UserInfo userInfo = new UserInfo();
public AuthorityManager()
{
//
//TODO: 在此处添加构造函数逻辑
//
//TcpClientChannel channel = new TcpClientChannel();
//ChannelServices.RegisterChannel(channel, false);
//string strRBPCServiceURL = ConfigurationManager.AppSettings["RBPC.Service.url"].ToString();
//string strRBPCServicePort = ConfigurationManager.AppSettings["RBPC.Service.port"].ToString();
string strRBPCServiceURL = ConfigurationManager.AppSettings["RBPCServiceAddress"].ToString();
string strRBPCServicePort = ConfigurationManager.AppSettings["RBPCServicePort"].ToString();
//string tcpChannel = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/";
string strAccountMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/IAccountManager";
log.Debug("*-*-strAccountMgrURL=" + strAccountMgrURL);
string strPermissionMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/IPermissionManager";
log.Debug("*-*-strPermissionMgrURL=" + strPermissionMgrURL);
string strRoleMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/IRoleManager";
log.Debug("*-*-strRoleMgrURL=" + strRoleMgrURL);
string strSecurityMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/ISecurityManager";
log.Debug("*-*-strSecurityMgrURL=" + strSecurityMgrURL);
accountMgr = (IAccountManager)Activator.GetObject(typeof(IAccountManager), strAccountMgrURL);
permissionMgr = (IPermissionManager)Activator.GetObject(typeof(IPermissionManager), strPermissionMgrURL);
roleMgr = (IRoleManager)Activator.GetObject(typeof(IRoleManager), strRoleMgrURL);
securityMgr = (ISecurityManager)Activator.GetObject(typeof(ISecurityManager), strSecurityMgrURL);
application = System.Configuration.ConfigurationManager.AppSettings.Get("RBPCApplication").ToString();
}
示例11: IsPermitted
private static bool IsPermitted(ISecurityManager security, object possiblyPermittable, IPrincipal user, ContentItem item)
{
var permittable = possiblyPermittable as IPermittable;
if (permittable != null && permittable.RequiredPermission > Permission.Read && !security.IsAuthorized(user, item, permittable.RequiredPermission))
return false;
return true;
}
示例12: CheckPermission
/// <summary>
/// Checks whether the user can perform the specified action.
/// </summary>
/// <param name="userName">The name of the user that is being checked.</param>
/// <param name="permission">The permission to check.</param>
/// <param name="defaultRight">The default right to use.</param>
/// <param name="manager"></param>
/// <returns>True if the permission is valid, false otherwise.</returns>
public virtual bool CheckPermission(ISecurityManager manager,
string userName,
SecurityPermission permission,
SecurityRight defaultRight)
{
return true;
}
示例13: CheckPermission
/// <summary>
/// Checks whether the user can perform the specified action.
/// </summary>
/// <param name="userName">The name of the user that is being checked.</param>
/// <param name="permission">The permission to check.</param>
/// <param name="defaultRight">The default right to use.</param>
/// <param name="manager"></param>
/// <returns>True if the permission is valid, false otherwise.</returns>
public virtual bool CheckPermission(ISecurityManager manager,
string userName,
SecurityPermission permission,
SecurityRight defaultRight)
{
return manager.CheckServerPermission(userName, permission);
}
示例14: DefaultIntroProvider
public DefaultIntroProvider(ISecurityManager security, IChannelManager channelManager, ILocalizationManager localization, IConfigurationManager serverConfig, ILibraryManager libraryManager)
{
_security = security;
_channelManager = channelManager;
_localization = localization;
_serverConfig = serverConfig;
_libraryManager = libraryManager;
}
示例15: EmpireManager
public EmpireManager(IEmpires empireRepository, ISecurityManager securityManager)
{
if (empireRepository == null) throw new ArgumentNullException("empireRepository");
if (securityManager == null) throw new ArgumentNullException("securityManager");
_empireRepository = empireRepository;
_securityManager = securityManager;
}