Esempio n. 1
0
        /// <summary>
        /// Create Organizational Access for all Automatic Roles
        /// </summary>
        /// <param name="org">org</param>
        /// <returns>true if created</returns>
        public static bool CreateForOrg(MOrg org)
        {
            int counter = 0;

            MRole[] roles = MRole.GetOfClient(org.GetCtx());
            for (int i = 0; i < roles.Length; i++)
            {
                if (!roles[i].IsManual())
                {
                    MRoleOrgAccess orgAccess = new MRoleOrgAccess(org, roles[i].GetAD_Role_ID());
                    if (orgAccess.Save())
                    {
                        counter++;
                    }
                }
            }
            _log.Info(org + " - created #" + counter);
            return(counter != 0);
        }