예제 #1
0
        public void Register(string name, string displayName)
        {
            if (!_apiScopeRepository.GetAll().Any(e => e.Name == name))
            {
                ApiScope apiScope = new ApiScope(name);

                apiScope.SetDisplayName(displayName ?? name);

                _apiScopeRepository.Insert(apiScope);
            }
        }
예제 #2
0
        public void Register(string name, string displayName, List <Permission> managePermissions, List <Permission> queryPermissions)
        {
            if (!ApiScopeRepository.GetAll().Any(e => e.Name == name))
            {
                ApiScope apiScope = new ApiScope(name);

                apiScope.SetDisplayName(displayName ?? name);

                managePermissions.ForEach(item => apiScope.ApiManageScope.AddPermission(item));
                queryPermissions.ForEach(item => apiScope.ApiQueryScope.AddPermission(item));

                ApiScopeRepository.Insert(apiScope);
            }
        }