isRoot() public static method

Sprawdza czy dany użytkownik ma rozszerzone uprawnienia
public static isRoot ( User user ) : bool
user User
return bool
Ejemplo n.º 1
0
        private void FindLocation_Load(object sender, EventArgs e)
        {
            User userAuth = AuthAdapter.GetInstance().getIdentity();

            if (!UserFactory.isRoot(userAuth))
            {
                this.button1.Visible = false;
            }
            this.dataGridView1.DataSource = DbService.GetAll <Location>();
        }
Ejemplo n.º 2
0
        private void UserEditorForm_Load(object sender, EventArgs e)
        {
            ICollection <UserRole> userRoles = DbService.GetAll <UserRole>();

            this.comboBoxRole.Items.Clear();
            this.comboBoxRole.Items.Insert(0, "");
            foreach (UserRole ur in userRoles)
            {
                this.comboBoxRole.Items.Insert(ur.vid, ur.vname);
            }
            userAuth = AuthAdapter.GetInstance().getIdentity();
            if (!UserFactory.isRoot(userAuth))
            {
                this.button2.Visible      = false;
                this.comboBoxRole.Visible = false;
            }
            this.plec.Items.Insert((int)SexEnum.Male, "mężczyzna");
            this.plec.Items.Insert((int)SexEnum.Female, "kobieta");
            this.textBoxName.Text            = userAuth.GetName();
            this.textBoxSureName.Text        = userAuth.GetSureName();
            this.dateOfBirthTimePicker.Value = userAuth.GetDateOfBirth();
            this.plec.SelectedIndex          = (int)userAuth.GetSex();
            this.comboBoxRole.SelectedIndex  = userAuth.vRole;
        }