?

Log in

No account? Create an account
allowmask xmlrpc - LiveJournal Client Discussions — LiveJournal [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

allowmask xmlrpc [Aug. 2nd, 2004|06:59 pm]
LiveJournal Client Discussions

lj_clients

[fbartho]
[mood |frustratedfrustrated]

I am currently fiddling with the xmlrpc client protocol for php... but this main question is centered on the xmlrpc part and has nothing to do with the php...

I am trying to figure out how to use the allowmask so that it actually tells me something interesting...

for example I am getting a result of 6 for the security of a certain post... Now from what I understand I need to get the 32 bit binary representation of that... but once I have that (a simple math operation right?) where do I go from there?... I searched on google, but all I could find were links to pages that were dealing with code from perl scripts that had allowmask in their comments somewhere, but that either did not apply to my problem, or were so confusing that I could not tell that they did...

I assume somehow, looking at the bitmask will give you a list of user id's who have access to the post, but I don't see where to go...

Sorry for the noobish questions... (I see that most of you have projects well beyond this stage) and Thanks.
linkReply

Comments:
[User Picture]From: darklyng
2004-08-02 05:46 pm (UTC)
It is also worth noting that the security level will be "usemask" for both friends-only and custom posts. This from the XMLRPC protocol docs sums it up quite well:

security(optional):


[scalar](required) Specifies who can read this post. Valid values are public (default), private and usemask. When value is usemask, viewability is controlled by the allowmask.


allowmask(optional):


[scalar](required) Relevant when security is usemask. A 32-bit unsigned integer representing which of the user's groups of friends are allowed to view this post. Turn bit 0 on to allow any defined friend to read it. Otherwise, turn bit 1-30 on for every friend group that should be allowed to read it. Bit 31 is reserved.

The only thing I would add to that is to clarify that the bit numbers in the allow mask correspond to the IDs of the friend groups, so if you want to make a post visible to groups with the IDs 1, 4 and 5, you need to set bits 1, 4 and 5 in the allowmask, ie. allowmask = 2^1 + 2^4 + 2^5 = 50.
(Reply) (Parent) (Thread)
[User Picture]From: fbartho
2004-08-02 09:45 pm (UTC)

eek, oops, ::: Ahh!

ok, This is a reply to both comments...

First, my humble apologies about the font... I posted from my lj.net client, where I have Comic Sans MS set as default font... when i use that I don't see the html font code, and it didn't even cross my mind that it might be a pain for others... In the future I will be certain that I don't have that happen again... though I personally like that font, I know that each person likes the entries in their journal to be displayed with their font, and so I will change my font choices to css style settings in my layout...

Now what you have said is extremely enlightening, I now understand the mention of a limit of 32 user groups, each group is a bit... tah dah...

I had understood the security=usemask... that struck me as a singularly uninformative value to have in a config value, so I quickly found that there was an allowmask= part... (out of curiosity, is allowmask null when a post is public? and what about friends only?)

Now my question is how to fetch the group members, or the groups of which a specific user is a member...

Thanks alot... It was a lightbulb that went on when you explained it... and I realized why it all made sense! :)
(Reply) (Parent) (Thread)