Skip to content

Bug: can() returns an error when user is not logged in #750

Closed

Description

@kibcode

PHP Version

8.1

CodeIgniter4 Version

4.3.5

Shield Version

1.0.0-beta.7

Which operating systems have you tested for this bug?

Windows, Linux

Which server did you use?

apache

Database

MySQL

Did you customize Shield?

No

What happened?

When i want to check permissions with can() and the user is not logged in shield produces an error. I always have to check with loggedIn() before using can().

Steps to Reproduce

Try to get a permission for guests.

Expected Output

can() should return false if a user is not logged in. It would also be nice to handle guests as a usergroup so users not logged in can have permissions too.

Anything else?

No response

Activity

  1. kibcode commented on Jun 12, 2023

    @kibcode
    Author

    Is there a good workaround i have missed so far?

  2. locked and limited conversation to collaborators on Jun 12, 2023
  3. converted this issue into a discussion #751 on Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions