How can I allow a user without edit permission to access a control which is of type edit?


I have a module which allows a user with Edit permission to add a new record or update a record in the database.  I would also like to be able to allow user's without Edit permission to Add and Update records they created.

In the view module's "ModuleActions" method I can add the following action:

actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.AddContent, LocalResourceFile), ModuleActionType.AddContent, "", "", EditUrl(), False, DotNetNuke.Security.SecurityAccessLevel.View, True, False)

This allows the user's without Edit permission to see the "Add Record" link at the bottom of the module.  However, when the user clicks on the link, the Edit control loads and returns the following error "You do not have access to view this module within the portal."

Is there a way to assign edit permission a control (ascx file)  without having the module permissions setting checked for a role?


11/26/2005 1:22:44 AM 4559 articles. 0 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 2

Why don't you just assign edit rights to All Users for that module?
11/27/2005 1:58:47 PM

Hi Lennon,

Thanks for the reply. 

I want the edit module to server a dual purpose.  Anyone with view permission should be able to add a new record and update any record they have created.  Anyone with edit permission can also add a new record, but they can also update any record and delete records.

My cheat was to create a second module, say "AllUsersEdit" and inside that module, I load the "AdminEdit" control and add it a placeholder on the page.  This allowed me to create two controls in the module definition.  "AllUsersEdit" is a "View" control and "AdminEdit" is an "Edit" control.

On another note, I originally tried to have one model (ascx page) defined as both a View and Edit control.  While the admin interface allows for this, my portal became very unhappy.  The module installer will not create the second control with the same ascx file, so I figured that was a bad thing to be doing.

If you have a better solution to my cheat, please let me know.


11/27/2005 3:04:53 PM
I would suggest using roles.  Have a UserEditor role and an AdminEditor role.  Assign users appropriately.  If the user is a member of UserEditor, then allow the user to edit (add/edit), but filter records seen based on UserId.  If the user is in the AdminEditor role, then no filter is necessary.

If you need the user to see all records, but only edit their own, then I would add a little script to the databound event of the web grid (or similar event of another control) and allow the edit button to be enabled (or even seen) for only records that have the UserId stamped on it.

Seems simple enough without having to resort to additional view/edit controls.

11/28/2005 6:53:07 PM

Similar Artilces:

Can a user see the shared scope without editing permission?
Hi,In SharePoint, each user can always view the Shared version or its personal version regardless the existence of editing/designing permission.However, in the Web Parts framework, I see that a user must be granted permission to see the shared scope (verbs="enterSharedScope") and if he has permission then he automatically can edit/design the shared version.How can I allow users to see each version (Shared and User) but edit/design only their personal (User) scope?Thanks. Its the same.  User goes into edit they are editing a copy of the shared personalization.  You ...

Admin can't see 'Edit Text' control at the bottom of editable modules
I have an admin who can't see the module level Edit command when logged into her machine.  If she changes to another machine, and logs in with the same account, it is fine, but from her machine she can't see the "edit" text or the pencil or the settings icon for any module.  She can see the Admin controls at the top, but the modules themselves seem to have no edit controls.There are no appreciable differences between the machines, that I know of.  They are build from the same Ghost image.  Obviously something is different but I have no clue what it would be.  Any tho...

How to allow to edit a page without being able to add a module to a page from control panel
Hello, I am using DNN 3.1.1 and it has been setup as an intranet. I would like to let selected uses based on their security role to be able to add  a new document to an existing document section or add/remove a contact from contact list etc. However, I do not wish them to be able add or manipulate intranet pages by having access to Control Panel where you insert a module to a page or run the wizard etc. At the moment members of that security role have both view and edit option What is the best way to do this?  Thanks Al   Just edit the settings on the module - to ...

DNN Forum/Blog Module
Is it possible in the DotNetNuke Forum/Blog module to allow a user to add/edit blogs but not have control of the entire module itself? I want the user to be able to add and edit the blogs but not to be able to delete the module or move it's location on the page. Thanks!- DerekTheGeek...

Can we access controls within user controls on the client side without using ctl0_ControlsName
When we create controls within our user controls, the way we can access those controls in client side is i guess:getElementByID('the client id')but the server chnages the names of those controls to:  clt0_Controlsname, so i always have to use add ctl0 when I want to access to my controls of the user control on the client there a solution to this or that s just the way it isthank you Thanks a lot, I appreciate your taking the time to help me. Hello tutus,this is maybe the most frequent question in this forum, did you notice?This problems is related to all server co...

DropDownList That User Can Type / Edit
I am trying to find out if there is a way to make a DropDownList that a user can also type into.  So, if a user visits a webpage with a DropDownList that contains 5 items, but maybe the user needs to input a new item for the DropDownList to submit to the database. For example, there is 1 DropDownList that populates from a database and has the 5 clients (items): Alpha, Bravo, Charlie, Delta, Echo.  But, the user needs to enter Foxtrot into the DropDownList.  Is there a way to allow the user to type into the DropDownList without having to create another control or somethin...

Problem getting a Datagrid to allow users to edit it...(in line editing)
Hi, In my DNN custom module I have three panels with various controls on them. If a user clicks the "edit database" makes all these panels disappear and one appear. That panel has a datagrid on it. My goal is to allow users to manipulate the database information using the datagrid. The datagrid is bound to a dataset which is pulled from the database and the data displays fine. I tried adding a button column to the datagrid (I'm using Visual Studio) and it puts a nice "edit" button to the left of every row in the database. Very nice. My understanding ...

Edit but no edit
I've Created a custom module and reuse the survey.dnn file to help with the install here it is. <?xml version="1.0" encoding="utf-8" ?> <dotnetnuke version="2.0" type="Module"> <folders> <folder> <name>CompanyName - Photos</name> <description>Photos allows you to add photo albums</description> <version>01.00.00</version> <modules> <module> <friendlyname>CompanyName - Photos</friendlyname> <controls> <c...

To edit or no to edit
Jon, Can I edit, whatever I've written so far, so that it doesn't look like I wrote utterly crap?-) -- Pieter "Linux is like living in a teepee. No Windows, no Gates, Apache in house." -- Usenet signature Pieter Zijlstra wrote: > Jon, > > Can I edit, whatever I've written so far, so that it doesn't look like > I wrote utterly crap?-) Oh boy, the edit button vanished from the web-forum ... ;-) -- Pieter "Humor is also a way of saying something serious." -- T. S. Eliot (1888 - 1965) Pieter Zijlstra wrote: ...

Allowing permission to edit module but not page?
So, I'd like to set up a user group that is allowed to edit the content of TEXT/HTML modules, but not be able to edit the page itself.  I'm running DNN 4.3.3 which I upgraded to from DNN 4.3.1. I've given the role permission to edit the module by changing the settings directly on the module but have run into 2 problems. First, the modules have been set up to hide the container so that they don't display to anyone visiting the site.  The problem is that the editors cannot see the module container if they don't have edit permission to the entire page, so they are unable to see the e...

Editable/Not Editable
Hello All, I have some webform(.aspx page) in which i have some controls (for input) and i would like to make that screen editable/not editable based on some condition. how can i do that.  the whole intent is user can read the information but can't change.  shiva kumar If you want to make the controls editable/non-editable, you can set their ReadOnly property to true or false accordingly. What exactly do you imply by making the screen editable/non-editable?Thanks,MaxLet Me Google That For You! i mean to say i would like to show the current values but user should not mod...

Allow editing of all rows simultaniously (without having to click edit/update for each row)?
I have an application where the user will be presented with perhaps 20 rows.  1 field of each row (the score) will need to be updated by the user.   Now with a gridview they would click on the first row's EDIT button then make the change for the Score field and then click update. Having to do this ~20 times would be somewhat annoying for the user :)  Is there any way I can get an Excel like behavior where the user can just click on the first row's Score field then enter the integer score and hit tab or down arrow or something and drop down to the next one and keep ...

Direct editing of gridView or Ddatagrid controls without clicking on an EDIT link
I have an application where lots of data is presented to the user in a gridView control and the user needs the option to review and overwrite any values in the cells of the grid.  My users find it very annoying and time consuming to click on an edit link to turn a row of the gridView into edit mode.  Typically, they might jump around and edit a few values in several rows.  Is there any way to present the data in a gridView control, datagrid control or something that looks like a grid where the entire grid is already in edit mode?  Can you make a grid that cont...

can I add a user control from other project to the custom module user control
Pls help! I am using the GCN for my web app, which I find it very useful and fit my needs. Since I must use VB for coding and the GCN use C#, so I use 3 layer project structure: 1) GCN (C#) 2) all skin controls for custom module for my community (VB) 3) Data Access Layer Components, dataset... etc (VB) Since the GCN only get the skin controls from the "custom module" folder, so I added a XXX.ascx there, now here's the problem, how can I add my own custom skin controls from other project to the XXX.ascx in GCN? ...

Web resources about - How can I allow a user without edit permission to access a control which is of type edit? -

Permission - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Facebook Fixing Vulnerability That Would Prohibit Users From Revoking App Permissions
Facebook is working to remedy a vulnerability discovered by application security provider MyPermissions , which blocks users of the social network ...

Dwight Murphy - Ok, I now have permission to share the... - Facebook
Ok, I now have permission to share the news about Bowe Bergdahl..This in 2 emails... Here it is in Bob Bergdahls words to me! (1) You guys rock! ...

How-To: Handle Revoked Auth Permissions
This how-to document will help developers check a user's permissions and prompt that user for any missing permissions.

Facebook gives users more options for login, app permissions
Facebook CEO Mark Zuckerberg’s new mantra of “Move fast with stable infra,” might not be as sexy as “ Move fast and break things ,” but it reflects ...

Davies McDonalds Happy Meal Project- all photos ©Sally Davies- use with permission only - an album on ...
View the album on Flickr. Flickr logo. If you click it, you'll go home Sign Up Explore Recent Photos The Commons 20under20 Galleries World Map ...

Arafat's widow grants permission for Swiss lab to test poisoning theory
The Palestinian Authority also approved the probe, which was requested by Palestinian president Mahmoud Abbas after a media investigation found ...

Michael Daniel Henderson who killed three teenagers in a smash denied permission to appeal
A driver who killed three teenagers in a hit-and-run smash in southeast Queensland has been refused permission to appeal his 10-year sentence. ...

CSIRO moves toward industrial action: seeks Fair Work permission for protected action ballot
CSIRO's new chief executive Larry Marshall could soon be faced with disruptive staff.

Resources last updated: 12/29/2015 3:02:00 PM