예제 #1
0
        private void Form_Load(object sender, EventArgs e)
        {
            _Storage = (IAzManStorage)Session["storage"];

            if (Session["selectedObject"] as IAzManStore != null)
            {
                _Store = Session["selectedObject"] as IAzManStore;
            }
            if (Session["selectedObject"] as IAzManApplication != null)
            {
                _Application = Session["selectedObject"] as IAzManApplication;
                _Store       = _Application.Store;
            }
            if (Session["selectedObject"] as IAzManItem != null)
            {
                _AuthItem    = Session["selectedObject"] as IAzManItem;
                _Application = _AuthItem.Application;
                _Store       = _Application.Store;

                _Authorization = _AuthItem.GetAuthorization(_AuthorizationID);
                MemberType memberType = _Authorization.GetMemberInfo(out _DisplayName);
            }
            if (Session["selectedObject"] as IAzManApplicationGroup != null)
            {
                _ApplicationGroup = Session["selectedObject"] as IAzManApplicationGroup;
                _Application      = _ApplicationGroup.Application;
                _Store            = _Application.Store;
            }

            SetAttributes();
            SetToolBar();
            SetListView();

            LoadList();
        }
예제 #2
0
        private void AddAuthDataRow(IAzManAuthorization authorization)
        {
            DataRow dr = _AuthData.NewRow();

            dr["AuthorizationID"] = authorization.AuthorizationId;
            dr["AttributesLink"]  = ""; // this.getAttributesLink((int)dr["AuthorizationID"]);
            string     displayName;
            MemberType memberType = authorization.GetMemberInfo(out displayName);
            string     ownerName;
            MemberType ownerType = authorization.GetOwnerInfo(out ownerName);

            dr["MemberType"]     = NetSqlAzManHelper.GetMemberTypeName(memberType, authorization.SID, _AuthItem);
            dr["MemberTypeEnum"] = memberType;
            dr["Owner"]          = ownerName;
            dr["Name"]           = displayName;
            dr["OwnerSID"]       = authorization.Owner;
            if (authorization.SidWhereDefined == WhereDefined.Database)
            {
                dr["ObjectSID"] = authorization.SID.StringValue;
            }
            else
            {
                dr["ObjectSID"] = authorization.SID.StringValue;
            }

            switch (authorization.SidWhereDefined.ToString())
            {
            case "LDAP": dr["WhereDefined"] = "Active Directory"; break;

            case "Local": dr["WhereDefined"] = "Local"; break;

            case "Database": dr["WhereDefined"] = "DB User"; break;

            case "Store": dr["WhereDefined"] = "Store"; break;

            case "Application": dr["WhereDefined"] = "Application"; break;
            }

            dr["WhereDefinedEnum"]      = authorization.SidWhereDefined;
            dr["AuthorizationType"]     = NetSqlAzManHelper.GetAuthTypeName(authorization.AuthorizationType);
            dr["AuthorizationTypeEnum"] = authorization.AuthorizationType;
            dr["ValidFrom"]             = authorization.ValidFrom.HasValue ? (object)authorization.ValidFrom.Value : DBNull.Value;
            dr["ValidTo"] = authorization.ValidTo.HasValue ? (object)authorization.ValidTo.Value : DBNull.Value;
            _AuthData.Rows.Add(dr);
        }
        private void AddAuthorizationDataRow(IAzManAuthorization authorization)
        {
            DataRow dr = this.dtAuthorizations.NewRow();

            dr["AuthorizationID"] = authorization.AuthorizationId;
            string     displayName;
            MemberType memberType = authorization.GetMemberInfo(out displayName);
            string     ownerName;
            MemberType ownerType = authorization.GetOwnerInfo(out ownerName);

            dr["MemberType"]     = this.RenderMemberType(memberType, authorization.SID);
            dr["MemberTypeEnum"] = memberType;
            dr["Owner"]          = ownerName;
            dr["Name"]           = displayName;
            dr["OwnerSID"]       = authorization.Owner;
            if (authorization.SidWhereDefined == WhereDefined.Database)
            {
                dr["ObjectSID"] = new SqlAzManSID(authorization.SID.BinaryValue, true);
            }
            else
            {
                dr["ObjectSID"] = authorization.SID;
            }

            switch (authorization.SidWhereDefined.ToString())
            {
            case "LDAP": dr["WhereDefined"] = Globalization.MultilanguageResource.GetString("WhereDefined_LDAP"); break;

            case "Local": dr["WhereDefined"] = Globalization.MultilanguageResource.GetString("WhereDefined_Local"); break;

            case "Database": dr["WhereDefined"] = Globalization.MultilanguageResource.GetString("WhereDefined_DB"); break;

            case "Store": dr["WhereDefined"] = Globalization.MultilanguageResource.GetString("WhereDefined_Store"); break;

            case "Application": dr["WhereDefined"] = Globalization.MultilanguageResource.GetString("WhereDefined_Application"); break;
            }

            dr["WhereDefinedEnum"]      = authorization.SidWhereDefined;
            dr["AuthorizationType"]     = this.RenderAuthorizationType(authorization.AuthorizationType);
            dr["AuthorizationTypeEnum"] = authorization.AuthorizationType;
            dr["ValidFrom"]             = authorization.ValidFrom.HasValue ? (object)authorization.ValidFrom.Value : DBNull.Value;
            dr["ValidTo"] = authorization.ValidTo.HasValue ? (object)authorization.ValidTo.Value : DBNull.Value;
            this.dtAuthorizations.Rows.Add(dr);
        }
        private void AddAuthorizationDataRow(IAzManAuthorization authorization)
        {
            DataRow dr = this.dtAuthorizations.NewRow();
            dr["AuthorizationID"] = authorization.AuthorizationId;
            string displayName;
            MemberType memberType = authorization.GetMemberInfo(out displayName);
            string ownerName;
            MemberType ownerType = authorization.GetOwnerInfo(out ownerName);
            dr["MemberType"] = this.RenderMemberType(memberType, authorization.SID);
            dr["MemberTypeEnum"] = memberType;
            dr["Owner"] = ownerName;
            dr["Name"] = displayName;
            dr["OwnerSID"] = authorization.Owner;
            if (authorization.SidWhereDefined == WhereDefined.Database)
            {
                dr["ObjectSID"] = new SqlAzManSID(authorization.SID.BinaryValue, true);
            }
            else
            {
                dr["ObjectSID"] = authorization.SID;
            }

            switch (authorization.SidWhereDefined.ToString())
            {
                case "LDAP": dr["WhereDefined"] = Globalization.MultilanguageResource.GetString("WhereDefined_LDAP"); break;
                case "Local": dr["WhereDefined"] = Globalization.MultilanguageResource.GetString("WhereDefined_Local"); break;
                case "Database": dr["WhereDefined"] = Globalization.MultilanguageResource.GetString("WhereDefined_DB"); break;
                case "Store": dr["WhereDefined"] = Globalization.MultilanguageResource.GetString("WhereDefined_Store"); break;
                case "Application": dr["WhereDefined"] = Globalization.MultilanguageResource.GetString("WhereDefined_Application"); break;
            }

            dr["WhereDefinedEnum"] = authorization.SidWhereDefined;
            dr["AuthorizationType"] = this.RenderAuthorizationType(authorization.AuthorizationType);
            dr["AuthorizationTypeEnum"] = authorization.AuthorizationType;
            dr["ValidFrom"] = authorization.ValidFrom.HasValue ? (object)authorization.ValidFrom.Value : DBNull.Value;
            dr["ValidTo"] = authorization.ValidTo.HasValue ? (object)authorization.ValidTo.Value : DBNull.Value;
            this.dtAuthorizations.Rows.Add(dr);
        }
        private void AddAuthorizationDataRow(IAzManAuthorization authorization)
        {
            DataRow dr = this.dtAuthorizations.NewRow();
            dr["AuthorizationID"] = authorization.AuthorizationId;
            dr["AttributesLink"] = this.getAttributesLink((int)dr["AuthorizationID"]);
            string displayName;
            MemberType memberType = authorization.GetMemberInfo(out displayName);
            string ownerName;
            MemberType ownerType = authorization.GetOwnerInfo(out ownerName);
            dr["MemberType"] = this.RenderMemberType(memberType, authorization.SID);
            dr["MemberTypeEnum"] = memberType;
            dr["Owner"] = ownerName;
            dr["Name"] = displayName;
            dr["OwnerSID"] = authorization.Owner;
            if (authorization.SidWhereDefined == WhereDefined.Database)
            {
                dr["ObjectSID"] = authorization.SID.StringValue;
            }
            else
            {
                dr["ObjectSID"] = authorization.SID.StringValue;
            }

            switch (authorization.SidWhereDefined.ToString())
            {
                case "LDAP": dr["WhereDefined"] = "Active Directory"; break;
                case "Local": dr["WhereDefined"] = "Local"; break;
                case "Database": dr["WhereDefined"] = "DB User"; break;
                case "Store": dr["WhereDefined"] = "Store"; break;
                case "Application": dr["WhereDefined"] = "Application"; break;
            }

            dr["WhereDefinedEnum"] = authorization.SidWhereDefined;
            dr["AuthorizationType"] = this.RenderAuthorizationType(authorization.AuthorizationType);
            dr["AuthorizationTypeEnum"] = authorization.AuthorizationType;
            dr["ValidFrom"] = authorization.ValidFrom.HasValue ? (object)authorization.ValidFrom.Value : DBNull.Value;
            dr["ValidTo"] = authorization.ValidTo.HasValue ? (object)authorization.ValidTo.Value : DBNull.Value;
            this.dtAuthorizations.Rows.Add(dr);
        }