public CswNbtWebServiceNbtManager(CswNbtResources NbtManagerResources, string AccessId, CswEnumNbtActionName ActionName, bool AllowAnyAdmin = false)
 {
     _NbtManagerResources = NbtManagerResources;
     _Action            = ActionName;
     _AllowAllAccessIds = _checkNbtManagerPermission(_NbtManagerResources);
     _OtherResources    = makeOtherResources(AccessId);
 } //ctor
        }//afterPopulateProps()

        protected override bool onButtonClick( NbtButtonData ButtonData )
        {
            if( null != ButtonData && null != ButtonData.NodeTypeProp )
            {
                string OCPPropName = ButtonData.NodeTypeProp.getObjectClassPropName();
                //Remember: Save is an OCP too
                if( PropertyName.LoadUserContext == OCPPropName )
                {
                    ButtonData.Data["action"] = OCPPropName;

                    ButtonData.Data["type"] = "view"; //assume it's a view unless it's an action
                    CswEnumNbtActionName ActionName = CswNbtAction.ActionNameStringToEnum( Action.Text );
                    if( CswResources.UnknownEnum != ActionName )
                    {
                        if( null != _CswNbtResources.Actions[ActionName] )
                        {
                            CswNbtAction action = _CswNbtResources.Actions[ActionName];
                            ButtonData.Data["type"] = "action";
                            ButtonData.Data["actionname"] = action.Name.ToString();
                            ButtonData.Data["actionid"] = action.ActionId.ToString();
                            ButtonData.Data["actionurl"] = action.Url.ToString();
                        }
                    }
                    else
                    {
                        ButtonData.Data["selectedNodeId"] = SelectedNodeId.Text;
                        if( null != CurrentViewMode )
                        {
                            ButtonData.Data["viewmode"] = CurrentViewMode.Text;
                        }
                        //CswNbtViewId delimitedViewId = new CswNbtViewId( CswConvert.ToInt32( View.SelectedViewIds.ToString() ) );
                        CswNbtViewId delimitedViewId = View.ViewId;
                        if( null != delimitedViewId )
                        {
                            ButtonData.Data["viewid"] = delimitedViewId.ToString();
                        }
                        if( null != Author.RelatedNodeId )
                        {
                            if( _CswNbtResources.CurrentNbtUser.UserId != Author.RelatedNodeId )
                            {
                                ButtonData.Data["userid"] = Author.RelatedNodeId.ToString();
                                CswNbtObjClassUser userNode = _CswNbtResources.Nodes[Author.RelatedNodeId];
                                if( null != userNode )
                                {
                                    ButtonData.Data["username"] = userNode.Username;
                                }
                            }
                        }
                    }
                    ButtonData.Action = CswEnumNbtButtonAction.loadView;
                }
            }
            return true;
        }
Esempio n. 3
0
        public void ToggleAction(bool showInList, CswEnumNbtActionName actionName)
        {
            string         databaseActionName = CswNbtAction.ActionNameEnumToString(actionName);
            CswTableUpdate actionTU           = _CswNbtResources.makeCswTableUpdate("toggleActionVisibility", "actions");
            DataTable      actionsDT          = actionTU.getTable("where actionname = '" + databaseActionName + "'");

            foreach (DataRow row in actionsDT.Rows)
            {
                row["showinlist"] = CswConvert.ToDbVal(showInList);
            }
            actionTU.update(actionsDT);
        }
Esempio n. 4
0
 public void set(CswEnumNbtActionName ActionName, CswNbtObjClassRole Role, bool value)
 {
     set(_CswNbtResources.Actions[ActionName], Role, value);
 }
Esempio n. 5
0
 /// <summary>
 /// Sets a permission for the given Action for the user
 /// </summary>
 public void set(CswEnumNbtActionName ActionName, ICswNbtUser User, bool value)
 {
     set(_CswNbtResources.Actions[ActionName], User, value);
 }
Esempio n. 6
0
 /// <summary>
 /// Sets a permission for the given Action for the user
 /// </summary>
 public void set(CswEnumNbtActionName ActionName, bool value)
 {
     set(_CswNbtResources.Actions[ActionName], _CswNbtResources.CurrentNbtUser, value);
 }
Esempio n. 7
0
        } // can( CswNbtAction Action, ICswNbtUser User )

        /// <summary>
        /// Returns true if the role has the appropriate permissions for the Action
        /// </summary>
        public bool can(CswEnumNbtActionName ActionName, CswNbtObjClassRole Role)
        {
            return(can(_CswNbtResources.Actions[ActionName], Role));
        }
Esempio n. 8
0
 /// <summary>
 /// Returns true if the user has the appropriate permissions for the Action
 /// </summary>
 public bool can(CswEnumNbtActionName ActionName, ICswNbtUser User)
 {
     return(can(_CswNbtResources.Actions[ActionName], User));
 }
Esempio n. 9
0
 /// <summary>
 /// Returns true if the current user has the appropriate permissions for the Action
 /// </summary>
 public bool can(CswEnumNbtActionName ActionName)
 {
     return(can(_CswNbtResources.Actions[ActionName]));
 }