Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsDocumentsDocumentsDelete Option in Document ModuleDelete Option in Document Module
Previous
 
Next
New Post
1/9/2008 11:09 AM
 

How can i limit the delete option only for the administrators ?

Suppose A & B are registered users.User A uploaded a file.User B can delete the file uploaded by User A.I want to avoid this.I want to make the delete option available only to the Administrators.

How can i achieve this ?

 
New Post
1/9/2008 3:50 PM
 

You would need to modify the code that exists in the EditDocument.ascx control to do a permissions check before you allow deletion.

It should be a fairly simple change.  One thing to remember also is that deleting an item from the documents module only deletes the link, it doesn't delete the file.

Please feel free to contact me directly if you need assistance.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
1/10/2008 8:31 AM
 

Can you provide me the code to do that  ?

 
New Post
1/10/2008 10:09 AM
 

I can't test this code anymore as I do not have VS 2003 installed so I cannot edit the current version of the documents module, I can only work with the new one.

In the EditDocs.ascx control, in the page_load event there is the following IF statement

' If the page is being requested the first time, determine if an

 

' document itemId value is specified, and if so populate page

 

' contents with the document details

If Not Common.Utilities.Null.IsNull(ItemID) Then

You will need to add something like

If UserInfo.IsInRole("Administrators") Then

    cmdDelete.Enabled = True

Else

    cmdDelete.Enabled = False

Ensure that your admin role is aministrators, you will then need to re-build the module to make the changes complete.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsDocumentsDocumentsDelete Option in Document ModuleDelete Option in Document Module


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out