Display protections in place for a given user, group, or path.
p4 [g-opts] protects [-s spec][-a | -u user | -g group] [-h host] [-m] [file ...]
p4 [g-opts] protects -M [-u user | -g group] [file ...]
Use the p4 protects
command to display the lines
from the protections table that apply to a user, group, or set of
files.
p4 protects
displays the lines
in the protections table that apply to the current user. If a
file
argument is provided, only those lines in the
protection table that apply to the named files are displayed.-a
option to display lines for all users, or
-u user
, -g group
, or -h
host
options to display lines for a specific user,
group, or host IP address.-m
option to display a one-word summary of the
maximum applicable access level.-M
option to display a one-word summary of the
maximum access level. Unlike the -m
option, it takes into
account exclusions against the specified file path.Use the -s
option to display protection information
from a protect table referenced by the file revision specified with
the spec
argument. For example, the following
command returns information about the user sam in the third revision
of the protections table:
$ p4 -u super protects -s //spec/protect.p4s#3 -u sam
write user * * //...
This is useful when users lose access privileges at a given point in time and you want to check what changes were made to the protection table just before that date.
To use this option, you must define a spec depot for protect forms;
this automatically saves revisions to the protect specification every
time you edit the protection table. See p4 depot
for
information on how to create a spec depot.
|
Displays protection lines for all users. This option requires
|
|
Displays protection lines that apply to the named
|
|
Displays protection lines that apply to the specified
|
|
Display a one-word summary of the maximum applicable access level. (Note: this does not take into account exclusionary mappings or the specified file path into account.) |
-M
|
Differs from -m because -M does take into account
exclusions and the specified file path.
|
|
Display information from the specified earlier version of the
protect file. The You must define a spec depot for protect forms in order to automatically save protect revisions every time you edit a form. |
|
Displays protection lines that apply to the named
|
|
See Global Options. |
Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required |
---|---|---|
No |
No |
|
dm.protects.allow.admin
configurable is set to
1
,
Perforce
administrators, in addition to
Perforce
superusers, can also use p4 protects -a
,
-g
, and -u
.
To edit the protections table |