Exemplo n.º 1
0
            private void AddJobPermissions()
            {
                DbDataReader jobPermissions = OSADataProvider.Device.ProvideJobPermissionsForGroups(userGroup);

                // Add/Override the permissions of loggedOn user
                while (jobPermissions.Read())
                {
                    foreach (object keyLine in GetPermissionKeyLine(jobPermissions["JOB_TYPE"].ToString()))
                    {
                        if (!acl.ContainsKey(keyLine.ToString()))
                        {
                            acl.Add(keyLine.ToString(), bool.Parse("True"));
                        }
                        else
                        {
                            acl[keyLine.ToString()] = bool.Parse("False");
                        }
                    }
                }
                jobPermissions.Close();

                // Set the permissions to false for remaining features
                foreach (string keyLine in MyAccountant.GetLimitMasterList())
                {
                    if (!acl.ContainsKey(keyLine))
                    {
                        acl[keyLine.ToString()] = false;
                    }
                }
            }
Exemplo n.º 2
0
            private void AddJobLimits()
            {
                DbDataReader jobLimits = OSADataProvider.Device.ProvideJobLimitsForGroups(userGroup);
                uint         jobLimit  = 0;

                // Add/Override the Limits of LoggedOn users
                while (jobLimits.Read())
                {
                    foreach (object keyLine in GetJobLimitsKeyLine(jobLimits["JOB_TYPE"].ToString()))
                    {
                        jobLimit = 1000;
                        if (jobLimit < 0)
                        {
                            jobLimit = 0;
                        }
                        if (!limit.ContainsKey(keyLine.ToString()))
                        {
                            limit.Add(keyLine.ToString(), jobLimit);
                        }
                        else
                        {
                            limit[keyLine.ToString()] = 0;
                        }
                    }
                }
                jobLimits.Close();

                // Set the limits as zero for remaining features
                foreach (string keyLine in MyAccountant.GetLimitMasterList())
                {
                    if (!limit.ContainsKey(keyLine))
                    {
                        limit.Add(keyLine, 0);
                    }
                }
            }