[p4] Best way to determine if user has read access to file...
Stephen Vance
steve at vance.com
Wed May 14 08:47:43 PDT 2008
If you run p4 dirs on the directory in question, it echoes the name if
it's a directory and tells you 'no such file(s)' if it's a file or missing.
Steve
Jamie.Echlin at barclayscapital.com wrote:
> OK, thanks, I have done.
>
> Here's another one though - given a path, how can I tell if that is a
> file or directory? Short of doing something like running p4 dirs in the
> directory above, and see if this particular directory is present?
>
>
>
>
> ________________________________
>
> From: Stephen Vance [mailto:steve at vance.com]
> Sent: 14 May 2008 14:19
> To: Echlin, Jamie: IT (LDN)
> Cc: perforce-user at perforce.com
> Subject: Re: [p4] Best way to determine if user has read access
> to file...
>
>
> Your protects command looks like it should work. You're right
> that you shouldn't have to parse the output. I'd ask if you belong to a
> group that has other permissions, but protects doesn't report that.
>
> I'd contact support. Sorry I can't be more helpful than that.
>
> Steve
>
> Jamie.Echlin at barclayscapital.com wrote:
>
> Yes, I considered that, the problem is with our security
> level I need to log them first, which again is not necessarily a
> problem. Performance is key though as this is part of the authentication
> for a web app, so if it can be done in one shot all the better.
>
> What i don't get is, if p4 protects cannot be used here,
> then what on earth is it good for?
>
>
> ________________________________
>
> From: Stephen Vance [mailto:steve at vance.com]
> Sent: 14 May 2008 13:57
> To: Echlin, Jamie: IT (LDN)
> Cc: perforce-user at perforce.com
> Subject: Re: [p4] Best way to determine if user
> has read access to file...
>
>
> You could try printing the file impersonating
> that user.
>
> p4 -u user print -q -o /dev/null
> //some/path/to/file
>
> Steve
>
> Jamie.Echlin at barclayscapital.com wrote:
>
> Cheers, but i need to do this
> programatically.
>
>
> ________________________________
>
> From: Stephen Vance
> [mailto:steve at vance.com]
> Sent: 14 May 2008 13:27
> To: Echlin, Jamie: IT (LDN)
> Cc: perforce-user at perforce.com
> Subject: Re: [p4] Best way to determine
> if user has read access to file...
>
>
> Use the relatively new P4V admin
> interface.
>
> Steve
>
> Jamie.Echlin at barclayscapital.com wrote:
>
> Afternoon,
>
> What's the best way to determine if a
> user has read access to a file,
> short of logging in as them and doing
> fstat or whatever.
>
> Let's say my protections are set up like
> this:
>
> write user echlinj *
> //depot/Jamgraph/...
> write user echlinj *
> -//depot/Jamgraph/REL1.0/...
>
> So I have no read/write access to stuff
> under REL1.0. I was hoping this
> would work:
>
>
>
> p4 -u p4admin protects -m -u echlinj
>
>
>
> //depot/Jamgraph/REL1.0/src/gparticle.cpp
> write
>
> However I don't have write access to
> that file.
>
> Without -m I get:
>
> write user echlinj *
> //depot/Jamgraph/...
> write user echlinj *
> -//depot/Jamgraph/REL1.0/...
>
> I don't really want to parse that to
> work out which line best matches
> the file in question. There must be a
> better way.
>
> Cheers,
>
> Jamie Echlin
> Head of Development Tools Engineering
> Barclays Capital, 10 The South
> Colonnade, Canary Wharf, London, E14 4PU.
> * Direct : +44 (0) 20 7773 4187 *
> jamie.echlin at barclayscapital.com
>
> <mailto:mike.bambrook at barclayscapital.com>
> <mailto:mike.bambrook at barclayscapital.com>
>
>
>
>
>
> _______________________________________________
>
> This e-mail may contain information that
> is confidential, privileged or otherwise protected from disclosure. If
> you are not an intended recipient of this e-mail, do not duplicate or
> redistribute it by any means. Please delete it and any attachments and
> notify the sender that you have received it in error. Unless
> specifically indicated, this e-mail is not an offer to buy or sell or a
> solicitation to buy or sell any securities, investment products or other
> financial product or service, an official confirmation of any
> transaction, or an official statement of Barclays. Any views or opinions
> presented are solely those of the author and do not necessarily
> represent those of Barclays. This e-mail is subject to terms available
> at the following link: www.barcap.com/emaildisclaimer. By messaging with
> Barclays you consent to the foregoing. Barclays Capital is the
> investment banking division of Barclays
> Bank PLC, a company registered in
> England (number 1026167) with its registered offi!
> ce at 1 Churchill Place, London, E14
> 5HP. This email may relate to or be sent from other members of the
> Barclays Group.
>
> _______________________________________________
>
>
> _______________________________________________
> perforce-user mailing list -
> perforce-user at perforce.com
>
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>
>
>
>
> --
> Stephen Vance
> www.vance.com
>
>
>
> _______________________________________________
>
>
>
> This e-mail may contain information that
> is confidential, privileged or otherwise protected from disclosure. If
> you are not an intended recipient of this e-mail, do not duplicate or
> redistribute it by any means. Please delete it and any attachments and
> notify the sender that you have received it in error. Unless
> specifically indicated, this e-mail is not an offer to buy or sell or a
> solicitation to buy or sell any securities, investment products or other
> financial product or service, an official confirmation of any
> transaction, or an official statement of Barclays. Any views or opinions
> presented are solely those of the author and do not necessarily
> represent those of Barclays. This e-mail is subject to terms available
> at the following link: www.barcap.com/emaildisclaimer. By messaging with
> Barclays you consent to the foregoing. Barclays Capital is the
> investment banking division of Barclays Bank PLC, a company registered
> in England (number 1026167) with its registered office at 1 Churchill
> Place, London, E14 5HP. This email may relate to or be sent from other
> members of the Barclays Group.
>
>
> _______________________________________________
>
>
> --
> Stephen Vance
> www.vance.com
>
>
> _______________________________________________
>
>
>
> This e-mail may contain information that is
> confidential, privileged or otherwise protected from disclosure. If you
> are not an intended recipient of this e-mail, do not duplicate or
> redistribute it by any means. Please delete it and any attachments and
> notify the sender that you have received it in error. Unless
> specifically indicated, this e-mail is not an offer to buy or sell or a
> solicitation to buy or sell any securities, investment products or other
> financial product or service, an official confirmation of any
> transaction, or an official statement of Barclays. Any views or opinions
> presented are solely those of the author and do not necessarily
> represent those of Barclays. This e-mail is subject to terms available
> at the following link: www.barcap.com/emaildisclaimer. By messaging with
> Barclays you consent to the foregoing. Barclays Capital is the
> investment banking division of Barclays Bank PLC, a company registered
> in England (number 1026167) with its registered office at 1 Churchill
> Place, London, E14 5HP. This email may relate to or be sent from other
> members of the Barclays Group.
>
> _______________________________________________
>
>
> --
> Stephen Vance
> www.vance.com
>
>
> _______________________________________________
>
> This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered of!
fi!
> ce at 1 Churchill Place, London, E14 5HP. This email may relate to or be sent from other members of the Barclays Group.
> _______________________________________________
> _______________________________________________
> perforce-user mailing list - perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>
>
--
Stephen Vance
www.vance.com
More information about the perforce-user
mailing list