[daisy] Publish immediately & no publishing permissions indocument editor

Iolanda Da Costa Martins Iolanda.Martins at chordiant.com
Fri Jun 6 23:28:35 CEST 2008


I knew the 1st part (that styling wasn't enough) :-) So your pointers
are great. I will try to get my head around this in the the coming days,
and when I get to implement it + it works, I will add a new improvement
JIRA issue with patches.

Thanks,

Io-

PS: in my case, it is really a matter of whether the user can publish or
not, therefore the border line cases do not apply. But I agree that it
could get complicated if the ACL rules are as peculiar as you mention.

-----Original Message-----
From: daisy-bounces at lists.cocoondev.org
[mailto:daisy-bounces at lists.cocoondev.org] On Behalf Of Karel Vervaeke
Sent: Friday, June 06, 2008 11:02 AM
To: Daisy: open source CMS - general mailinglist
Subject: Re: [daisy] Publish immediately & no publishing permissions
indocument editor

It is currently not possible to do that using styling, so there would be
some more work involved.

There is one little catch: you can't really be sure that the user will
be allowed to publish unless you have the complete document information
(e.g. an Acl entry might deny publish rights if the document exceeds a
particular amount of bytes).  Don't worry too hard though: (a) this is a
bordercase and (b) one could work around this by submitting the document
temporarily by hitting the html cleaner button or by going back and
forth to another tab in the editor.

Anyway, now for the implementation part:

look for publishImmediately in documenteditor.xml, you will either want
to
(a) hide the checkbox if the user is not allowed to publish
(b) make the checkbox unchecked + disabled
(c) just display a warning if the user tries to uncheck it.

in DocumentEditorApple.java, add something like this: (copied from
LocalDocumentStrategy.store(...)

AclResultInfo newAclInfo =
context.getCommonRepository().getAccessManager().getAclInfoOnLive(system
User,
documentInt.getCurrentUser().getId(),documentInt.getCurrentUser().getAct
iveRoleIds(), document);

boolean canPublish = newAclInfo.isAllowed(AclPermission.PUBLISH);

(put the canPublish parameter in the viewData so you can use it in the
documenteditor.xml template)

This seems like a general improvement, so feel free to create a Jira
issue.  Don't forget to attach a patch if you implement this.

Regards,
Karel


On Thu, 2008-06-05 at 22:40 +0100, Iolanda Da Costa Martins wrote:
> I have a Document Collection where a certain role does not have
publishing permissions.
>  
> However, a user acting in that role can still see the 'publish
immediately' check box/label and check it before saving. I know that it
does not work: ie, if the save option is selected but the user does not
have such permissions, the result will be a new draft version, not
publish version.
>  
> I would like to do is to hide away that option when the ACL says that
the publish permission is denied. 
>  
> I know how I can filter out stuff based on ACL in the menus, but I can
not find a way of doing this in the editor.
>  
> Cheers,
>  
> Iolanda
> Chordiant Software International Ltd. Registered office: Chiswick Park
Building 10, 566 Chiswick High Road, London W4 5XS Registered in UK no.
02155722 and VAT no. GB 479 9023 02 The information transmitted herewith
is sensitive information of Chordiant Software or its customers and is
intended only for use to the individual or entity to which it is
addressed. If the reader of this message is not the intended recipient,
you are hereby notified that any review, retransmission, dissemination,
distribution, copying or other use of, or taking of any action in
reliance upon, this information is strictly prohibited. If you have
received this communication in error, please contact the sender and
delete the material from your computer.
> _______________________________________________
> daisy community mailing list
> Professional Daisy support: 
> http://outerthought.org/en/services/daisy/support.html
> mail to: daisy at lists.cocoondev.org
> list information: http://lists.cocoondev.org/mailman/listinfo/daisy
_______________________________________________
daisy community mailing list
Professional Daisy support:
http://outerthought.org/en/services/daisy/support.html
mail to: daisy at lists.cocoondev.org
list information: http://lists.cocoondev.org/mailman/listinfo/daisy
Chordiant Software International Ltd.  Registered office: Chiswick Park Building 10, 566 Chiswick High Road, London W4 5XS  Registered in UK no. 02155722 and VAT no. GB 479 9023 02  The information transmitted herewith is sensitive information of Chordiant Software or its customers and is intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.


More information about the daisy mailing list