/// <summary>
        /// Deletes the feature.
        /// </summary>
        /// <param name="featureId">The feature identifier.</param>
        /// <returns>The removal status.</returns>
        public async Task <bool> DeleteFeature(int featureId)
        {
            List <ISPRolePermission> roleFeatureList = new List <ISPRolePermission>();

            roleFeatureList = roleFeatureDataService.GetRolesForFeatureId(featureId);
            if (roleFeatureList.Count() == 0 /*&& menuList.Count() == 0*/)
            {
                return(await featureDataService.DeleteFeature(featureId));
            }
            else
            {
                List <string> taggedMenuItems = new List <string>();
                List <string> roleNames       = new List <string>();
                foreach (var item in roleFeatureList)
                {
                    var role = await roleDataService.GetById(item.RoleId);

                    roleNames.Add(role.RoleName);
                }

                return(false);
            }
        }
Example #2
0
 /// <summary>
 /// Get Role By Id
 /// </summary>
 /// <param name="roleId">Role Id</param>
 /// <returns>ISP Role</returns>
 public async Task <ISPRole> GetById(int roleId)
 {
     return(await sproleDataService.GetById(roleId));
 }