Reputation: 498
I have a Notes Form containing many fields, tabbed tables, embedded views etc. Editing access is restricted to a small group via an Author field and the ACL to prevent changes to most of the data. However, I also need to allow editing of one or two fields to a wider user group. In essence the opposite to what one can do with Controlled Access Sections.
A move to XPages on this one is not a realistic option in this instance.
I know it is probably a non-starter but any help would be appreciated.
Upvotes: 0
Views: 364
Reputation: 12060
I would also follow the path that Richard describes in his respons, but without the delay. Write an agent, that Runs on behalf of a person / server who is allowed to edit everything in that database.
Then create a form that you open in a dialog that the user can fill and call the agent with runonserver.
Example code might look like this:
Dim ws as New NotesUIWorkspace
Dim ses as New NotesSession
Dim db as NotesDatabase
Dim ag as NotesAgent
Dim docTmp as NotesDocument
Dim strID as String
Dim varOK as Variant
Set db = ses.CurrentDatabase
Set ag = db.GetAgent( "RunMeOnServerOnBehalfOfSomeone" )
Set docTmp = new NotesDocument( db )
call docTmp.ReplaceItemValue( "ChangeUNID", docToEdit.UniversalID )
varOK = ws.Dialogbox( "YourSpecialDialogForm", True, True, False, False, False, False, "Enter values", docTmp, True, False, True )
If not varOK then exit sub
Call docTmp.Save( True, True, True ) '- runonserver cannot be called with a notesdocument that is unsaved
strId = docTmp.NoteID
Call ag.RunOnServer( strID )
In the agent you read the unid of the document to change and write the values from the docTmp to the target document.
Don't forget to cleanup the docTmp in the agent or in the code later.
of course you can use "reusable" parameter documents or one document per user. depending on how often this function ist needed.
But this seems to be a bit of a stretch (you need to keep track in your agent WHO requested a change, as all documents will be saved by the signer of the agent and not the user himself.
Probably a better solution would be to ADD the users to the author- field of the document and simply PROTECT everything else in the document with access controlled sections. You can completely hide those section headers and everything so that nobody can collapse them or if you don#t like the look of them.
Upvotes: 1
Reputation: 14628
There's no way to allow users without Author access the ability to directly edit part of the document. The only option I can think of would be to give them the ability to click a button that allows them to type their changes into a new temp document (using a form that only contains the fields that you want to expose), and set up an agent that runs when docs are created or modified that reads those documents copies the data from them back into the original document. There can be a bit of a delay before the changes are applied, though, so you'll have to warn users of that.
Upvotes: 0