コード例 #1
0
        public IActionResult AddProjectToUserGroupByCode(long projectId, [FromBody] AssignPermissionToSingleUserGroupContract data)
        {
            m_authorizationManager.AuthorizeBookOrPermission(projectId, PermissionFlag.AdminProject, PermissionNames.AssignPermissionsToRoles);

            m_permissionManager.AddBookToSingleUserGroup(projectId, data.Code, data.Permissions);
            return(Ok());
        }
コード例 #2
0
        public void AddProjectToUserGroupByCode(long projectId, AssignPermissionToSingleUserGroupContract data)
        {
            try
            {
                m_client.Post <object>($"project/{projectId}/single-user-group", data);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }