is_permitted

Package: WA2L/edrc 1.5.57
Section: Library Commands (3)
Updated: 08 November 2020
Index Return to Main Contents

 

NAME

is_permitted - check if a functionality is permitted to be started

 

SYNOPSIS

edrc/lib/is_permitted [ -h ]

is_permitted functionality [ options ]

 

AVAILABILITY

WA2L/edrc

 

DESCRIPTION

the main intention of this command is to check if a certain functionality is permitted for execution in contributed commands.

In recovery scripts global functionality and script functionality can be checked for startup permission.

This enables you to minimize possible by-passes of the denials defined in the DENY_LIST in the edrc config file edrc.cfg(4).

This allows to restrict functionality when an edrc configuration is used for special purposes (as: application- or operation support or to software control but don't want to give the user all freedom of changing things).

If a certain checked functionality (e.g.: /shell) is not permitted to be started, the message

  edrc-WARNING: execution of functionality 'shell' not permitted.

is displayed

 

OPTIONS

-h
usage message.

functionality
functionality to check if it is permitted to start depending on the setting in the DENY_LIST of the edrc config file edrc.cfg(4).

The functionality is the string defined in the @PROVIDES@ tag in the contributed command or general edrc functionalities.

To list all functionalities, invoke the edrcperm command in edrc.

Non-existing functionalities are treated as permitted.

Check if functionality of the own (e.g: edrcupgrade) contributed command is permitted to be started:

  if [ `is_permitted seturl` = True ]; then  
      :
      :
  if

Check if global low-level edrc functionality (low level functionality has an underscore '_' in the name) is permitted to start:

  if [ `is_permitted edit_file` = True ]; then  
      :
      :
  if

Check if a global edrc functionality is permitted to be started:

  if [ `is_permitted /shell` = True ]; then  
      :
      :
  if

  if [ `is_permitted /env.new` = True ]; then  
      :
      :
  if

Check if a specific functionality start of a specific contributed command is permitted:

  if [ `is_permitted /contrib.logs.view` = True ]; then  
      :
      :
  if

options
comma separated list or options for is_permitted:

NOLOG
do not log positive denial message into session log file.

 

ENVIRONMENT

-

 

EXIT STATUS

0
call of the functionality is permitted.

In addition True is returned to stdout.

1
call of the functionality is not permitted.

In addition False is returned to stdout.

4
usage displayed.

 

FILES

-

 

EXAMPLES

See contributed commands in edrc/contrib/edrc/ for examples of the is_permitted command.

 

SEE ALSO

edrcintro(1), contrib(1m), contrib.edrc(1m), edrc(1m), edrc.cfg(4)

 

NOTES

See also manpages contrib(1m), contrib.edrc(1m), edrc(1m) and edrc.cfg(4) to understand the edrc permission system.

 

BUGS

-

 

AUTHOR

is_permitted was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net . 

 

COPYRIGHT

Copyright © 2020 Christian Walther

This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 16:53:16 GMT, August 28, 2024