Beispiel #1
0
 //public void asignarPermisos(string espacioID, NewUserDetails user)
 //{
 //    Alfresco.AccessControlWebService.Reference Ref = new Alfresco.AccessControlWebService.Reference();
 //    Alfresco.AccessControlWebService.Store spacesS = new Alfresco.AccessControlWebService.Store();
 //    spacesS.scheme = Alfresco.AccessControlWebService.StoreEnum.workspace;
 //    spacesS.address = "SpacesStore;"
 //    Ref.store = spacesS;
 //    Ref.uuid = espacioID;
 //    Ref.path = null;
 //    Alfresco.AccessControlWebService.Predicate pred = new Alfresco.AccessControlWebService.Predicate();
 //    pred.Items = new Object[] { Ref, spacesS, null };
 //    Alfresco.AccessControlWebService.ACE[] aceRemove = new Alfresco.AccessControlWebService.ACE[1];
 //    aceRemove[0] = new Alfresco.AccessControlWebService.ACE();
 //    aceRemove[0].authority = user.userName;
 //    aceRemove[0].permission = Constants.ALL_PERMISSIONS;//Constants.COORDINATOR;
 //    aceRemove[0].accessStatus = Alfresco.AccessControlWebService.AccessStatus.declined;
 //    WebServiceFactory.getAccessControlService().removeACEs(pred, aceRemove);
 //    Alfresco.AccessControlWebService.ACE[] aceWrite = new Alfresco.AccessControlWebService.ACE[1];
 //    aceWrite[0] = new Alfresco.AccessControlWebService.ACE();
 //    aceWrite[0].authority = user.userName;
 //    aceWrite[0].permission = "Consumer";//Consumer Permissions
 //    aceWrite[0].accessStatus = Alfresco.AccessControlWebService.AccessStatus.acepted;
 //    WebServiceFactory.getAccessControlService().addACEs(pred, aceWrite);
 //}
 public string getHomeFolder(string usuario)
 {
     Alfresco.AdministrationWebService.AdministrationService administrationService = new Alfresco.AdministrationWebService.AdministrationService();
     administrationService = WebServiceFactory.getAdministrationService();
     Alfresco.AdministrationWebService.UserDetails detallesUser = new Alfresco.AdministrationWebService.UserDetails();
     detallesUser = administrationService.getUser(usuario);
     string homeFolder = string.Empty;
     for (int i = 0; i < detallesUser.properties.Length; i++)
     {
         if (detallesUser.properties[i].name.ToString() == "{http://www.alfresco.org/model/content/1.0}homeFolder")
         {
             homeFolder = detallesUser.properties[i].value.ToString();
             i = detallesUser.properties.Length;
         }
     }
     return homeFolder;
 }
Beispiel #2
0
        //public void asignarPermisos(string espacioID, NewUserDetails user)
        //{
        //    Alfresco.AccessControlWebService.Reference Ref = new Alfresco.AccessControlWebService.Reference();
        //    Alfresco.AccessControlWebService.Store spacesS = new Alfresco.AccessControlWebService.Store();

        //    spacesS.scheme = Alfresco.AccessControlWebService.StoreEnum.workspace;
        //    spacesS.address = "SpacesStore;"
        //    Ref.store = spacesS;
        //    Ref.uuid = espacioID;
        //    Ref.path = null;

        //    Alfresco.AccessControlWebService.Predicate pred = new Alfresco.AccessControlWebService.Predicate();
        //    pred.Items = new Object[] { Ref, spacesS, null };

        //    Alfresco.AccessControlWebService.ACE[] aceRemove = new Alfresco.AccessControlWebService.ACE[1];
        //    aceRemove[0] = new Alfresco.AccessControlWebService.ACE();
        //    aceRemove[0].authority = user.userName;
        //    aceRemove[0].permission = Constants.ALL_PERMISSIONS;//Constants.COORDINATOR;
        //    aceRemove[0].accessStatus = Alfresco.AccessControlWebService.AccessStatus.declined;

        //    WebServiceFactory.getAccessControlService().removeACEs(pred, aceRemove);

        //    Alfresco.AccessControlWebService.ACE[] aceWrite = new Alfresco.AccessControlWebService.ACE[1];
        //    aceWrite[0] = new Alfresco.AccessControlWebService.ACE();
        //    aceWrite[0].authority = user.userName;
        //    aceWrite[0].permission = "Consumer";//Consumer Permissions
        //    aceWrite[0].accessStatus = Alfresco.AccessControlWebService.AccessStatus.acepted;

        //    WebServiceFactory.getAccessControlService().addACEs(pred, aceWrite);
        //}

        public string getHomeFolder(string usuario)
        {
            Alfresco.AdministrationWebService.AdministrationService administrationService = new Alfresco.AdministrationWebService.AdministrationService();
            administrationService = WebServiceFactory.getAdministrationService();
            Alfresco.AdministrationWebService.UserDetails detallesUser = new Alfresco.AdministrationWebService.UserDetails();
            detallesUser = administrationService.getUser(usuario);
            string homeFolder = string.Empty;

            for (int i = 0; i < detallesUser.properties.Length; i++)
            {
                if (detallesUser.properties[i].name.ToString() == "{http://www.alfresco.org/model/content/1.0}homeFolder")
                {
                    homeFolder = detallesUser.properties[i].value.ToString();
                    i          = detallesUser.properties.Length;
                }
            }
            return(homeFolder);
        }