Ejemplo n.º 1
0
 public IHttpActionResult GetRoles(string userId)
 {
     if (userId == null)
     {
         return(BadRequest());
     }
     return(_roleManager.GetRoles(userId) == null ? (IHttpActionResult)NotFound() : Ok());
 }
 public IHttpActionResult GetRoles(string userId)
 {
     if (string.IsNullOrWhiteSpace(userId))
     {
         return(BadRequest("Incorrect input data value"));
     }
     return(_roleManager.GetRoles(userId) == null ? (IHttpActionResult)NotFound() : Ok());
 }
Ejemplo n.º 3
0
        private void ListRoles()
        {
            base.ServiceBroker.Service.ServiceObjects[0].Properties.InitResultTable();
            DataTable results = base.ServiceBroker.ServicePackage.ResultTable;

            UserRoleManager urmServer = this.ServiceBroker.K2Connection.GetConnection <UserRoleManager>();

            using (urmServer.Connection)
            {
                Role[] roles = urmServer.GetRoles();
                foreach (Role r in roles)
                {
                    DataRow row = results.NewRow();
                    row[Constants.SOProperties.Role.RoleName]        = r.Name;
                    row[Constants.SOProperties.Role.RoleDescription] = r.Description;
                    row[Constants.SOProperties.Role.RoleDynamic]     = r.IsDynamic;
                    results.Rows.Add(row);
                }
            }
        }
Ejemplo n.º 4
0
        private void ListRoles()
        {
            base.ServiceBroker.Service.ServiceObjects[0].Properties.InitResultTable();
            DataTable results = base.ServiceBroker.ServicePackage.ResultTable;

            UserRoleManager urmServer = new UserRoleManager();
            using (urmServer.CreateConnection())
            {
                urmServer.Connection.Open(base.BaseAPIConnectionString);
                Role[] roles = urmServer.GetRoles();
                foreach (Role r in roles)
                {
                    DataRow row = results.NewRow();
                    row[Constants.SOProperties.Role.RoleName] = r.Name;
                    row[Constants.SOProperties.Role.RoleDescription] = r.Description;
                    row[Constants.SOProperties.Role.RoleDynamic] = r.IsDynamic;
                    results.Rows.Add(row);
                }
            }
        }
        private void ListRoles()
        {
            ServiceObject serviceObject = this.Service.ServiceObjects[0];
            serviceObject.Properties.InitResultTable();
            DataTable results = this.ServicePackage.ResultTable;

            UserRoleManager urmServer = new UserRoleManager();
            using (urmServer.CreateConnection())
            {
                urmServer.Connection.Open(WFMServerConnectionString);
                Role[] roles = urmServer.GetRoles();
                foreach (Role r in roles)
                {
                    DataRow row = results.NewRow();
                    row[Constants.Properties.RoleName] = r.Name;
                    row[Constants.Properties.RoleDescription] = r.Description;
                    row[Constants.Properties.RoleGuid] = r.Guid;
                    row[Constants.Properties.RoleDynamic] = r.IsDynamic;
                    row[Constants.Properties.RoleExtraData] = r.ExtraData;
                    results.Rows.Add(row);
                }
            }
        }