Пример #1
0
            public override void DownloadPrivileges()
            {
                IEnumerable <GrantedSysPrivilege> newPrivs =
                    manager.downloadUserRolePrivileges(userRole);

                if (newPrivs.Count() > 0)
                {
                    privileges.Clear();
                    privileges.AddRange(newPrivs);
                }
                else
                {
                    OracleCommand    cmd = new OracleCommand(CURRENT_USER_PRIVS_SELECT, conn);
                    OracleDataReader odr = cmd.ExecuteReader();

                    if (odr.HasRows)
                    {
                        privileges.Clear();
                    }

                    while (odr.Read())
                    {
                        GrantedSysPrivilege grant = SysPrivManager.LoadPrivilege(odr);
                        // add it
                        privileges.Add(grant);
                    }
                }
            }
Пример #2
0
        public RoleManager(SessionManager.Session session)
        {
            if (session == null)
            {
                throw new ArgumentNullException("Session");
            }

            this.session = session;
            this.conn    = session.Connection;
            privManager  = session.PrivManager;
        }
Пример #3
0
            public PrivManagerLocal(SessionManager.Session session, UserRole userRole)
            {
                if (session == null || userRole == null)
                {
                    throw new ArgumentNullException("Session or User");
                }

                this.manager          = session.PrivManager;
                this.conn             = session.Connection;
                this.userRole         = userRole;
                this.localRoleManager = userRole.RoleManager;
                // create privilege view
                defaultView = CollectionViewSource.GetDefaultView(privileges) as ListCollectionView;
            }
Пример #4
0
            public Session(OracleConnection conn)
            {
                if (conn == null)
                {
                    throw new ArgumentNullException("Connection");
                }

                this.conn = conn;

                try
                {
                    // create managers
                    privManager   = new SysPrivManager(this);
                    roleManager   = new RoleManager(this);
                    userManager   = new UserManager(this);
                    schemaManager = new SchemaManager(this);
                    // store current user reference
                    currentUser = userManager.SessionUser;
                }
                catch (Exception e)
                {
                    MessageBox.Show(string.Format("Exception caught:\n{0}", e.Message));
                }
            }